Feature Request: Retry aws ecr get-login

Hi, there.
I am facing the following error along with 150 parallel agents with ecr-buildkite-plugin#v1.1.2.
Authenticating with AWS ECR | 6s
  | An error occurred (ThrottlingException) when calling the GetAuthorizationToken operation (reached max retries: 4): Rate exceeded
  | 🚨 Buildkite Error: The global pre-command hook exited with a status of 255

http://docs.aws.amazon.com/AmazonECR/latest/userguide/common-errors.html
I couldn't find how to increase retry times of aws ecr get-login command.
How about implement sleep and retry if aws ecr get-login is failed.

Makes a lot of sense!


⚠ Bofrost.lu has degraded performance

In 43ccb31, Bofrost.lu (https://www.bofrost.lu) experienced degraded performance:

HTTP code: 200
Response time: 2634 ms

Resolved: Bofrost.lu performance has improved in da906a9 after 57 minutes.


Add support new response headers: Current-Page & Total-Pages

Hi. I added support new response headers: Current-Page & Total-Pages.
Example:
$ curl --include 'https://localhost:3000/movies?page=5'
HTTP/1.1 200 OK
Link: <http://localhost:3000/movies?page=1>; rel="first",
  <http://localhost:3000/movies?page=173>; rel="last",
  <http://localhost:3000/movies?page=6>; rel="next",
  <http://localhost:3000/movies?page=4>; rel="prev"
Total: 4321
Per-Page: 10
Current-Page: 5
Total-Pages: 433
# ...

Hiya; first off, thanks for taking the time to contribute! I wanted to ask what your specific need for these two headers was? The Current-Page header would contain information already available to the client because they explicitly requested a page (and if they didn't, it should always be page 1). And the Total-Pages is already present in the Link headers as part of the rel="last" URL. So I'm a bit hesitant to add these headers because it feels superfluous...

I need to develop something http://developer.itrp.com/v1/general/pagination in several projects. Each project uses your gem for pagination.
This request from front-end developers for convenience.

Yeah I guess this just feels like an edge case. The information you're requesting is technically already present in the response that the api-pagination gem returns; it can be parsed or calculated out of the link headers or is already known because it was requested in the URL. I know that's not the response you'd prefer, so sorry about that. If you don't want to maintain a fork, I'd recommend requesting the front-end devs get the information out of the existing headers (or in the case of Current-Page, out of the requested URL). Any client application would already need to be parsing Link headers anyway, so I don't feel like this really adds that much convenience. Sorry again!


Modules

Could it be split in separated modules?
Because not it links all related Frameworks even I need only one.

This is a great idea but it's currently not supported...
I'll ping you when I know more. Thanks!


When using a Select with multiple, and selecting items the popup box is moved flickerly upwards

When using a Select with the property multiple enabled, when I start to select Menu Items the Menu(small box over the select), suddenly moves upwards more-less 5 pixels. I think this is an unwanted behavior

[x] The issue is present in the latest release.
[x] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯
Selecting items in the Select box makes it move upwards more-less 5 pixels. Look at it:

Expected Behavior 🤔
Selecting items shouldn't make the MenuItems move upwards

Steps to Reproduce 🕹

Sandbox: https://codesandbox.io/s/material-demo-forked-v0h9q?file=/demo.tsx
Steps:

Place a Select with property multiple, the MenuItems is moved upwards

Context 🔦
Using the   without problems

Your Environment 🌎

Tech
Version

Material-UI
v4.11.0

React
v16.13.1

Browser
Chrome V84

TypeScript
4.0.3

etc.

Duplicate of #19245


plot_2D_phase_diagram fails if there is one solution only

Self-explanatory - when trying to plot a 2D phase diagram where all points have the same value, get
PyError
ValueError('array of sample points is empty')

Closed by #44


Add rustfmt skip to default frame benchmarking template

This was missed in the introduction pr of rustfmt. There we only had
updated the Substrate local template.

bot merge


Add 'Tripple Click To Edit' to User Control Module Parameters Tab

People keep trying to double-click and it doesn't work. It'd be nice to find a better way to edit, but for now lets just add more instructions to the UI.

its actually "slow double click" but agreed

I guess I'm impatient.  I just click frantically until it lets me do what I want.

multicolumn listbox is like 1995 technology you have to be patient :P

I think with 2 clicks should eb enough , lets test with the changes we made with the API, if we need something else we will reopen this but in the table API


Inconsistent behavior of summary with  tag

Whether the .Summary contains rendered markdown or plain text varies based on whether I use <!--more--> or <!-- more --> (note the extra whitespace) as the separator. If I use the spaceless separator, the summary is rendered, but if there is a space in the separator, the Markdown seems to run through plainify first.
Seems related to #5109 but unintentional?
Expected behavior:
I think either  <!-- more --> with a space should not work at all or it should work the same as the version without a space.

It looks like it was just a coincidence that the .Summary looked right, but actually <!-- more --> did nothing.


SLO support using back channel

For our django project I implemented SLO support using back channel as an addition to this nice application.
Are you interested in including this in the upstream project or is this considered out of scope?
This introduces a dependency on spyne (and lxml) and needs an additional database table for mapping shibboleth sessions to django sessions (since we can't access the session of the user using the back channel).
Perhaps I could make back channel SLO and the dependencies belonging to it a configurable / optional feature?
I currently tested this on the test server of our service (using shibboleth-sp2 version 2.5.3 of Ubuntu 16.04), since I needed / wanted an IdP server to interact with.
Unfortunately there is no release of spyne, that is working with a recent Django, but with current master (b3bb2571d), it works fine.
This currently lacks tests and I'm not sure how / if that can be done.
Perhaps it is possible to simulate the IdP soap request by using the django.test.TestCase.client.
If you don't think this is generally out of scope, please review it and let's discuss what needs to be done to get this merged.

@egroeper thanks for your work. I think this work is in-scope for this package. Here are some thoughts:

I think it would be great to have this feature be optional.
I'd rather depend on a released version of spyne.

1. I think it would be great to have this feature be optional.

I will try that.
2. I'd rather depend on a released version of spyne.

I'm with you. I first tried with the latest release, but it didn't work out. Using the current master worked. By just looking through the commit history of spyne, I currently can't see a reason for that. I will reinvestigate.

This now works with spyne 2.12.14

Made this feature optional and added some tests. Should be okay now.
Anything else to do?

I now improved / finished the SOAP modelling and reactivated xml input validation.
Some documentation would be nice. Should I try to extend the Optional section of the README or do you think this would better fit in a separate file?

@egroeper Either way is fine with the documentation. You could try extending the Optional section of the README, and then move it to a new file if it gets too long.

I think we may have a problem here with Django <1.10 and first-request logins.
If session.session_key is None, then (in Django <1.10) on login the session gets created (persisted in database) and after that gets deleted immediately. Because of that inserting the SLO session mapping fails (foreign key constraint).
Seems like we can't test this with the django test framework. I will investigate further.
Currently I see the issue in Seafile, when the clients, which don't support cookie persistence, try to login with Shibboleth. But the same could be true for first-request logins.
I like the idea of using a foreign key for the session mapping table. That way we don't have to care about cleaning up our table. But this comes with the drawbacks, that we rely on the usage of the db SessionStore (which is quite common) and that the session needs to be already persisted in the database when our middleware runs.
Currently I would mention that (need for db SessionStore) in the docs and stay with using a foreign key. But of course we could simply make an independent table (giving us the burden to think about table cleanup).

Seems like we can't test this with the django test framework. I will investigate further.
Currently I see the issue in Seafile, when the clients, which don't support cookie persistence, try to login with Shibboleth. But the same could be true for first-request logins.

I could now reproduce the issue using Chromium webbrowser, when calling the shibboleth login endpoint of my webapp directly (before that I deleted all site cookies and disabled the embedded discovery service).
509bd91 should fix the issue.

Please don't merge this, yet. I'm still investigating an issue when both front-channel and back-channel logout are in place.

For back-channel SLO to work you need to configure service notification in the shibboleth sp.
But if this is in place, it will be used whether the logout was initiated by the IdP or through visiting /Shibboleth.sso/Logout. So if we redirect to that endpoint for SLO initiated from the django app, a SOAP call back to our webapp is made and it is tried to log the user out another time, which fails for obvious reasons.
One possible solution would be to not do the user logout (auht.logout()) in the ShibbolethLogoutView if back-channel SLO is configured, but only redirect to the SLO endpoint. Logout is then done through back-channel.
Here a new question arises: Do we want to support django project with additional authentication backends beside Shibboleth?
In that case we should only redirect the shibboleth sessions to the SLO endpoint and, of course, call auth.logout() in all other cases.
Perhaps it would then be better to have an own SHIBBOLETH_SLO_REDIRECT variable?

Does this package currently work with other authentication backends? If not, seems like we wouldn't need to worry about it for this feature.

Yes. I'm pretty sure, that it is currently possible to combine local (database) accounts, Shibboleth authentication and even other backends like LDAP.
Introducing SLO complicates things, when it comes to other authentication backends.
That's because we then need additional steps or even need to omit steps on logout.
I will try to find a solution and you can review the patch and we discuss, if something and what should be changed.


Flaky test test_reorged_cancel

What happens in test_reorged_cancel is that sometimes some participants see the transaction as spent instead of canceled.
https://github.com/revault/revaultd/blob/1261b190be9f37c66369b72f703e50a393277247/tests/test_misc.py#L1415-L1420
The problem is in the function unvault_spender, which fails to recognize the cancel as a cancel, returns it as if it was a spend instead.
https://github.com/revault/revaultd/blob/1261b190be9f37c66369b72f703e50a393277247/src/daemon/bitcoind/poller.rs#L891-L930
This happens because, for some reason, is_current with the cancel_txid returns Err(Server(Rpc(RpcError { code: -5, message: "Invalid or non-wallet transaction id", data: None }))) here:
https://github.com/revault/revaultd/blob/1261b190be9f37c66369b72f703e50a393277247/src/daemon/bitcoind/poller.rs#L908-L911
A couple of lines below, we retrieve the spender of the unvault (which is still the cancel_txid) assuming it's a spend, and is_current returns true:
https://github.com/revault/revaultd/blob/1261b190be9f37c66369b72f703e50a393277247/src/daemon/bitcoind/poller.rs#L921-L927
So we return "yo, the unvault has been spent by the Spend tx cancel_txid", we mark the vault as spent, and the test fails.
I think is_current is behaving like that because it takes some time for the node to re-align itself after a big reorg.
We could solve this problem by fetching the spender of the unvault bitcoind.get_spender_txid(&unvault_outpoint, &previous_tip.hash)? and then compare it to the cancel_txid, unemer_txid, or otherwise return it as a spend.
What do you think?

Good catch.
I agree. I think there is a bug in the unvault_spender logic: it shouldn't mark it as a Spend if the spending tx is actually a presigned tx (we can check that) because it would otherwise stick! https://github.com/revault/revaultd/blob/5dfbf0618f504a12a122202cac7c8668fd12a51f/src/daemon/bitcoind/poller.rs#L920-L927
While thinking about this, i think there are different possibilities to make these edge cases less likely to be triggered, all hacks:

Wait longer when polling the tip, we can afford it since reorgs are expected to be really rare under normal conditions. https://github.com/revault/revaultd/blob/5dfbf0618f504a12a122202cac7c8668fd12a51f/src/daemon/bitcoind/poller.rs#L597-L605 Of course this is still a race, but will be caught at the next poll.
Have a better detection of bitcoind continuing to process blocks while we are rescaning. Our current mechanism is pretty useless and we could at least check the tip didn't change https://github.com/revault/revaultd/blob/5dfbf0618f504a12a122202cac7c8668fd12a51f/src/daemon/bitcoind/poller.rs#L636-L639 Although this is not a big issue as such as we would detect the reorg at the next poll.
Force re-broadcast of pre-signed transactions. If we notice a previously-confirmed transaction went unconfirmed, we sendrawtransaction it to force its inclusion in the mempool. Actually we did this before but i removed it as i figured it wasn't really useful and bitcoind would just do the job.

I've added a commit in #237 that fixes the trouble, but doesn't implement your suggestions. We can leave this issue open, so we can work on the suggestions later

No they aren't really suggestions, i think it's better to close this now and know where to find it in case we ever need it :)


XLS-39d: rename lsfAllowClawback to lsfAllowTrustLineClawback

We are renaming lsfAllowClawback to lsfAllowTrustLineClawback to make it clearer that this flag is specifically used for IOUs. By renaming it, we want to separate this flag from potential future token types (like CFT) that may also support clawback functionality. This change is aimed at addressing technical debt caused by IOUs, so that we can avoid adding new flags at the account level in the future. Instead, we plan to control settings at the token level, rather than the account level.
Eg. CFT will have a token-level toggle for clawback and not use lsfAllowClawback, so it's better to rename this flag to be explicit that it is only used for trust line, to avoid confusions in the future.

Should asfAllowClawback be renamed as well?

I think it should be mentioned in the spec as that is how you enable and asf have different values than lsf

@ckniffen I don't think other specs mention it either. I guess it's implied that they will have the same name 🤷


Optimize animations for Chromecast

The buffering spinner is today based on SVG + CSS3 animation.  It appears to perform poorly on Chromecast.  Visually, it is not animating smoothly.
I have tried a few alternatives, but it is not yet clear if the spinner itself is fully to blame.  Before we go further on creating a new spinner, we should do a quantitative analysis of the performance issues we're seeing.
Here are some ideas here that may be useful once we have some baseline data:

https://plus.google.com/110558071969009568835/posts/NMDm5mDhm6J
http://www.html5rocks.com/en/tutorials/speed/high-performance-animations/

The G+ post suggests that the idle card may influence performance even while hidden.  The HTML5 Rocks article suggests that we should avoid animating colors.  Both articles recommend against the use of shadows.
Here are some open-source CSS spinners: https://github.com/lukehaas/css-loaders
Many of these use shadows, but if we relax the author's single-div requirement, some of them can be done with background colors and transforms.

@joeyparrish  I'm not sure we add it, since we want to do https://github.com/shaka-project/shaka-player/issues/4214 in the future

Fair.  I think it's also somewhat better since this issue was originally filed 6 years ago.  The spinner used to also change colors.  :-)


feat: add application support for macOS and Linux

It would be nice to have out-of-the-box support for macOS and Linux. Right now an app created with very_good_cli only supports Android, iOS, Windows and Web.
Sorry if this is a duplicate, I couldn't find a similar issue here.

Hi @dmiedev 👋
Thanks for opening an issue!
Unfortunately we are still blocked on https://github.com/flutter/flutter/issues/64088 for MacOS. I believe we should be able to add Linux support though -- I'll verify shortly 👍

same issue.

Is Flavors still the best approach for platform-specific configuration in Flutter? I don't want to spread misinformation, but Flavors was borrowed from Android where it is well-supported, but the Flutter dev docs have precious little information regarding the use of flavors cross-platform and delegate to a bunch of articles which talk about how it isn't well-supported in iOS (or MacOS obv). Having a separate entry point per flavor might seem ok (does it?) when we are talking about dev/test/prod, but what about when the permutations start to grow to include a/b testing and canary/staging/etc?
There are other libraries for sharing configuration between native and Dart. Why not use these instead?

https://pub.dev/packages/flutter_config
https://pub.dev/packages/environment_config

caveat - I have not used these, but plan to evaluate

Hey @felangel could we expect the support for macOS since [118421]https://github.com/flutter/flutter/pull/118421 was merged recently?
Also Linux support would be great as well.

Hey @felangel could we expect the support for macOS since #118421 was merged recently?
Also Linux support would be great as well.

Hey 👋
Yes we’re planning to work on this very soon. Flavor support in MacOS is not yet available on the stable channel afaik but we plan to address this soon after the changes are available on stable.

@felangel Any update?

Any update?

me also voting for this issue as macos flavoring updated in flutter 3.10

macos flavoring updated in flutter 3.10

This is an excellent issue for people willing to contribute!
We have this in our backlog, but this is not at the top of our priorities compared to other stuff we have to do. If you are reading this and think you can do it, we have a great contributing guide that may help to find where to plug the wires.
This should be done on the following templates:

Very good core (start app)
Very good wear app
Very good flame game

I'd like to try and take this on, currently working on adding macos support to the starter app template!

PR is up for the starter app template! I forgot this was for both macOS and Linux though - I don't have access to a Linux machine for development so I would only be able to do the macOS side of this.

Thanks @mxknt so much for your contributions. Renaming this issue to track the remaining linux platform.

Sure thing!


Update installation guide for v11 (aarch64)

@emcastillo Could you merge this one before the release? :pray:


UI: Disable the next button and empty the bottom page for invalid filter.

Pr raised https://github.com/debezium/debezium-ui-poc/pull/129

pr merged.


[cpp-client] add multi topic for consumer #3494

Signed-off-by: xiaolong.ran<EMAIL_ADDRESS>Fixes #3494
Motivation
add multi topic for consumer fix issue:3493

@wolfstudy Would you please help change the name and content of this issue?
As @merlimat mentioned, this is not related too much to "multi topic". It is adding InitialPosition support when subscribe.

rerun cpp tests
rerun java8 tests


%sveltekit.assets% should behave the same for "shortcut icon" and "apple-touch-icon" as it does for "icon"

Describe the problem
I am getting lots of 404 errors for apple-touch-icon files as (some?) browsers try to load it from deeper paths.
Describe the proposed solution
This was solved for rel="icon" in https://github.com/sveltejs/kit/pull/5583.
The same behaviour should be applied to rel="shortcut icon" and rel="apple-touch-icon"
Alternatives considered
No response
Importance
nice to have
Additional Information
No response

Whoever implements this should have access to a Safari browser to check that the weird scroll breakage observed in an earlier version of #5583 does not occur.

FWIW, SvelteKit automatically adding the origin to create absolute URLs for certain images, but not others, was a huge headache getting started with Svelte Kit for a couple days as I figured out how to handle metadata for my images and when to include the origin for canonical URLs, icons, og image, etc.
It was difficult because npm run dev outputs relative URLs (makes sense because of Vite), npm run build outputs relative URLs (okay good to know), but running the production app has absolute URLs  in dev console (!) for some paths added automatically but not all(!) and inspecting the actual source (cmd+option+u in Chrome) shows relative paths in production.
I ended up with double origins in my URLs before realizing SK adds them automatically.
TLDR I'd recommend not making this permanent in SK. It's worth revisiting if the browser bug warranting this has been resolved because the fix makes SK's DX unpredictable for URL handling. Or at the very least, should be documented.
IMO, for a real project, it doesn't make sense to include any assets, other than favicon.ico directly from the static dir, which might make this issue void.
It's better to include them in a <svelte:head> ... </svelte:head> in a main +layout.svelte so they can be hashed and benefit from far futures cache headers, which may help address any browser 404 issue. Only favicon.ico should be unhashed.
Here's a really well-researched article on the required meta for favicon and touch icons for today's browsers: https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs

I am getting lots of 404 errors for apple-touch-icon files as (some?) browsers try to load it from deeper paths.

Curious if your paths start with / like /image.png or are image.png? The latter could cause issues.

I'm using the same method described by @jasongitmail, because I've encountered a problem that when posting a message to Slack, Slack uses apple-touch-icon for the site icon in the message preview and can't get it from <link rel="apple-touch-icon" href="%sveltekit.assets%/apple-touch-icon.png" /> from src/app.html.
P.S. The article from EvilMartians is really great, but partially outdated. Chrome, due to a bug, loads both the ICO and SVG version of the favicon. You can check this in Chrome at the link from the previous post. On my side, I fixed this by replacing sizes="any" with sizes="32x32".

@Serator thanks for the note, I updated the article

@ai loved your article!! Just a little update:
In chapter Step 2: Create an ICO file the cli argument for inkscape is (maybe nowadays) invalid. I made it work with --export-png instead of --export-filename :blush:
Accordingly for chapter Step 3: Create PNG images :+1:

@andylib93 thanks =^_^=
Strange.
$ inkscape --help | grep export-filename
  -o, --export-filename=FILENAME             Output file name (defaults to input filename; file type is guessed from extension if present; use '-' to write to stdout)
	inkscape --export-filename=out.pdf in.svg

And I can’t find export-png in inkscape --help.

@ai that is indeed strange, but it seems like I need to upgrade my version, in the cli-documentation under Deprecations and Replacements it says --export-png needs to be replaced with --export-type="xyz".
My mistake 😇


Update filenames in README

This won't really change much but in terms of syntaxis, it looks better.


fix incorrect variable overwrite

fixed an issue found by static code analysis in which a variable
is incorrectly overwritten.

Refer to this link for build results (access rights to CI server needed):
https://edge-jenkins.isgtesting.com/job/test_team-build-maestro/171/

Refer to this link for build results (access rights to CI server needed):
https://edge-jenkins.isgtesting.com/job/test_team-build-maestro/171/


'declared but never used' for type parameter when there is a broken import

TypeScript Version:  nightly (2.3.0-dev.20170331)
Code
import { Foo } from "bad-import";

export interface I<T> {
    x: Foo<T>;
}

Expected behavior:
Only an error at the import.
Actual behavior:
src/a.ts(3,20): error TS6133: 'T' is declared but never used.

Another case:
import { foo } from "badImport";

type T = number;
foo<T>();

Another case:
import { A, B } from "unknown";
export class C extends A<B> {}

B is marked unused.

Hello, it seems to be fixed on typescript@next. However since this issue can affect users of Typescript v2.2.2 and v2.3 and tslint, would it be possible to ship it in<EMAIL_ADDRESS>instead of 2.4?

I have a similar problem: ERROR in ng:///C:/Projekte/groupify/src/app/export/export.component.html (2,1): '$event' is declared but never used.
But the code inside my export.component.html looks like: <button (click)="export()">Export</button>

And yes, the error go away after I set noUnusedParameters to false.

@Chris2011 I can't really help you without a reproducible code sample. Can you find-all-references on $event to see if you have any uses?

I did a full text search. I will have a look later to see where it comes from. I thought it could be the same error here, thats why I jumped in.

Not sure if this helps anyone, but I solved this "bug" by removing an incorrect spread props {...this.props} in a parent react component.

I'm getting a lot of these in a piece of code that was working fine a couple of days ago. They seem a bit random. One that caught my eye (because it happens again and again in different files) says:
[16:12:52]  tslint: src/pages/detail.ts, line: 4
                  All imports are unused.
       L4:  import { Http } from "@angular/http";

And the relevant code is:
import { Http } from "@angular/http";
export class detail {
    constructor(private http: Http) {}

    pushData(url, payload) {
        this.http.post(url, payload).map(res => res.json()).subscribe(data => console.log(data));
    }
}

Also, this one:
'ErrorHandler' is declared but never used.

import { ErrorHandler } from "@angular/core";
export class MyErrorHandler implements ErrorHandler {
}

I don't know why TSLint started picking these as errors. But it sure started today.

@andy-ms Yep, that worked. Thanks!


[docs] Fix duplicated styles generated from emotion

This PR fixes duplicated classes generated for the components that use emotion as styled engine.

The styles are identical. I couldn't find any other solution, this is the only relevant discussion I stable apon https://github.com/emotion-js/emotion/issues/1061, but we already use the CacheProvider for the ltr/rtl styles generated.

@Andarist Is the Gatsby integration still up to date? The code and documentation seem to suggest data-emotion instead of data-emotion-css.
@mnajdova did you try with the above change?

@oliviertassinari nice catch - just fixed this: https://github.com/emotion-js/emotion/commit/0d47e57d143f96efd2846a1cac9e8bb29c0650fb . We have indeed changed the format of this attribute between v10 and v11 to cover dynamic cache creation that has been causing hydration mismatches in v10 (just an edge case - we had only a single report about it).

@mnajdova did you try with the above change? I suspect that the cache stye hydration is broken, which could speed up the initial rendering once fixed.

It fixed the issue indeed. I just need to see how to incorporate the RTL scenario  as well

After merging https://github.com/mui-org/material-ui/pull/23796 which fixes the rtl issues, seems like everything works as expected. No duplicated classes in both ltr and rtl.

Perfect 👌


CI passes when job services failed to start.

Need more checks in the acceptance test in travis-ci

Close it as fixed.


Discache TTL: Verify that metrics are correctly evicted after expiration

check correctness of eviction
check metrics are correctly refetch from backend

done


Identity token lifetime management

Question
So, we have access_token for APIs and id_token for client to show like 'Hello Alice!' and access_tokens can be refreshed using approach like ATM. But, what is the recommendation for id_token lifetime that cannot be refreshed that easily in that case? Also, Microsoft OIDC client by default creates Principal from id_token and for apps that are quite old (monolith, OWIN, you know.. (and it even doesn't redeem code for access_token by default..) that drives us towards bad practice of managing access via it (say, role claims inside id_token). What would be your recommendation here too? If it was already discussed I will be glad for the link as couldn't find it after several tries.
I was even thinking about adding Principal created from access_token, but cookie handler doesn't work with multiple principals, so that would not be easy to do.

In OIDC you would use the access token to refresh the claims of the user at the userinfo endpoint.
Generally speaking i would not recommend putting data that frequently changes into tokens.

Thanks for clarification.

Hm.. but I suppose that wouldn't work out of the box in case of federation. As gateway, at least in some scenarios, will need to ask other IDP.

True. The protocols don't help you here. You need to come up with custom data management.


--syslog doesn't seem to work

I used the --syslog option and still the output went to stderr and nothing in /var/log/syslog.
Ubuntu 17.04 built with go1.9.1

It's possible you are running into the condition commented here: https://github.com/square/ghostunnel/blob/master/main.go#L120
We should investigate and/or log a message when this condition happens.

This is on an Ubuntu 17.04 cloud instance. The main issues I was having was starting ghostunnel from Python with dynamic parameters so I tried the —syslog option.
The log messages seemed the same when I was starting with —syslog by hand from the terminal.


Getting Rid of Com.Ericmas001 libs for Protocol

Protocol uses 4 libraries Com.Ericmas001, but uses like 1 feature per DLL. Check if possible to get rid of them, .Net DLL of Protocol will be easier to implement by other projects.

Done ! 2.0.0


dm-verity support

When given the correct command line parameters, these generators produce
systemd services to manage a cryptographically verified, read-only mounting of
the usr partition.
The expected cmdline parameters are:
mount.usr= which should point to our device-mapper target (e.g. /dev/mapper/usr)
verity.usr= which identifies the underlying physical device
verity.usrhash= which supplies the dm-verity root hash
See also https://github.com/coreos/seismograph/pull/27 and https://github.com/coreos/scripts/pull/412

LGTM


IPv6 support

The server should support both IPv4 and IPv6.
Banning and locking code will need to be updated to support them.

I'm currently thinking of implementing an IP list class similar to how a network router would work: by having a sorted list of IP prefixes and binary searching over the list, and the longest prefix is returned when there is more than a single match.
The class would have one such list for each of IPv4 and IPv6. IPv4 addresses mapped as IPv6 addresses would be automatically be converted back to IPv4.
This class would also replace the existing cidr.js
Time complexity (ignoring JIT optimisations):

Lookup: O(log N)
Insertion and Deletion: O(N)

Memory complexity: O(N)

Alternatively, this could be done using red-black trees for O(log N) insertion and deletion.
I won't be writing a RB-tree implementation though, so that would require pulling another dependency

Does SockJS support IPv6? I was operating under the assumption that it didn't.

I believe it does, since I think I ran a small IPv6 test for tbt once and it worked without problems (other than bans/locks not working properly).
Other than that, IPv6 can also be exposed via a reverse proxy, where the proxy handles everything IPv6, with the only evidence that the connection was IPv6 is in the X-Forwarded-For header

Sadly, I don't have IPv6 support so I can't test this.

Most computers have it enabled by default for localhost (::1).
Just swap out the bind IP in sockets.js with :: and try connecting to either http://ip6-localhost.psim.us/ (Should get an IP of ::1) or http://localhost.psim.us/ (Should get an IP of ::ffff:<IP_ADDRESS>)
I just tested it just then and it worked fine.

After thinking about it further, neither of my initial solutions would work correctly (or at least with good performance).
Instead, I've created a npm module (https://www.npmjs.com/package/ip-router) that does it properly with a patricia tree.
Insertion, Deletion, Lookup are all O(P) where P is the prefix length for the IP subnet (Typically 32 for IPv4 and 64 for IPv6)

I'm waiting for #1471 to be pulled first so I don't create any conflicts while implementing this

Some notes on banning/locking:

Will default to a /64, since ISPs will give out at least a /64 to each customer, and typical consumer routers don't support prefix delegation, so they will only use a single /64 if allocated more than that.
For the few evaders who know how to change to other /64s in their allocation, that can be solved by what we do currently for "router resetting" evaders - a range ban, but a /56 or /48 depending on the ISP's allocation size
Will be more "accurate", since ISPs will likely not give dynamic IPv6 subnets, so a well placed range ban will only ban the user and nobody else from that ISP

Banning a range by default is a good idea, but I'm not entirely sure if it's a good idea now that I think about it. For example, in schools, an user may have an unique IPv6 address, and banning an entire range could as well ban an entire school when it's not needed (this is how currently bans work with IPv4, but if school is nice enough to provide unique IPv6 addresses, why not use that to restrict ban impact?).
Second, a user may not necessarily have /64 allocation. While indeed, it's recommended for users to have allocation of that size (because certain IPv6 features don't work with smaller allocations), some stupid ISPs think that they are going to make smaller allocations because why not. For example, Comcast says "We will allocate a single IPv6 address (/128), since we know that only a single device is connecting, with no additional need to sub-net." What is this, I don't even... Although, this is The Worst Company of America according to Consumerist in 2014, so perhaps I shouldn't be surprised.
Third, /64 is minimal recommended allocation, but RFC6177 actually recommends /56 in order to let subscribers make subnets in their allocation (RFC3177 recommended /48, but that was obsoleted by RFC6177). If abuser's ISP provides /56, avoiding a ban on /64 range is very easy if somebody insists.
Evasion caused by changing IP within a an allocation (if somebody knows how to do that, most people won't) could be dealt with with manual range lock anyway.

The main problem that leads me to want to ban a /64 by default is because of privacy extensions, which is enabled by default on the majority of OSes.
Simply resetting your network connection to the device, not router, will give you a completely different address. This makes it far faster and easier to change IPv6 addresses (within the /64) than with the old "reset router" method.
For your second point, that appears to be true, but also seems to be being phased out at the same time.
From one of my server logs, approximately 1.5k unique /64 and 5.5k unique /72 prefixes have connected in the past. Of that:

AT&T or Comcast IPs

600 /64s
4k /72s have connected only for one or two days
150 /72s have connected for three or more days

In general

5.3k /72s have connected only for one or two days
200 /72s have connected for three or more days

As for your third point, that was addressed by my earlier first and second points. Consumer routers don't do prefix delegation, so by default they will pick the first /64 in the range allocated to them and only use that.

Okay, that is convincing. If you don't need any special configuration to get a new IPv6 address, it's probably better to ban /64.

One possible compromise would be checking if the latter 64 bits is a valid EUI-64 address, and if it is, ban just the /128 instead of the full /64.
Though, a grand total of 21 IPv6 addresses connected so far (out of the 1.5k /64s) have used an EUI-64 address...

@Joimer @Slayer95 @monsanto
Any opinions/comments on the above?

I'm still skeptical that it won't make it significantly easier to evade.

I guess we can revisit this after I'm done with timed locks, though.

What are you skeptical about? I'll address your concerns directly

Do we have any documentation that blocking a /64 will block a user?

Considering that IPv6 doesn't actually solve any problems for us, my initial opinion is :-1: if its support makes life even marginally more difficult for our moderators.

@Zarel
http://stackoverflow.com/questions/10967534/rate-limiting-banning-ips-in-ipv6
http://serverfault.com/questions/258466/how-are-ip-based-rules-eg-bans-filters-affected-once-ipv6-becomes-the-standar
Also, the RFC @xfix linked.
Almost all sources point to end-users being allocated either a /64 or /56.
As for banning a /64 rather than /128, see the above discussion with xfix.
All end-user equipment in their default configuration only ever use the first /64 in their allocated subnet. This is unlikely to change for a long time, since using more than a single /64 at once would require a prefix delegation server on the router and a prefix delegation client on the connecting device.
All the consumer routers I've seen that support IPv6 (at least 5 different brands in the past year), do not come with a prefix delegation server.
Windows by default has its prefix delegation client turned off.
For the few smart people that evade by changing /64s in their larger (e.g., /56) allocations, they can be treated the same as people who currently do the "restart router" trick to evade - a range ban, but this time on a /56.
Changing /64s within your allocation is hard, since it always involves some manual configuration of your router - harder than simply restarting it. That's also compounded by the fact that most IPv6-capable consumer routers don't even have a configuration option for it in their GUIs.
Note that some ISPs are giving out dynamic IPv6 addresses (e.g., comcast), but these can be treated no differently than current dynamic IPv4 addresses.

I guess we can revisit this after I'm done with timed locks, though.

Can we revisit it now, @Zarel?

Is this actually important to anyone? @_@

If someone pullreqs with IPv6 disabled by default, I'd accept it..

@Zarel - does that mean that you'd have it disabled on Main?

Also, @kotarou3 - is this something you were still interested in doing?

Yes, I'd want it disabled on Main.
Like, banning /64's solves some issues, but not all of them, and in general it'd be nice to be able to test on other servers before doing too much to it.

Note: in case the sockets rewrite gets merged, configuring the Go servers to accept both IPv4 and IPv6 connections is simple: just replace any instance of "tcp4" with "tcp" in sockets/main.go. No other changes to the Go files are necessary

I have no desire to run IPv6 on main. Someone would have to convince me that we have something to gain by doing so. If someone wanted to send a patch for IPv6 support they'd have to convince me that it wouldn't be a maintenance burden. I don't want to accept something that will just bitrot.


fix: some problems when server starting

What this PR does:

fix the starting problem
adjust some logging settings
bugfix: when input an illegal SQL, the session will be disconnected, and it will cause mycli reports reconnect... repeatedly forever.

Which issue(s) this PR fixes:

Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:

Codecov Report
Patch coverage: 9.67% and no project coverage change.

Comparison is base (3ea47a2) 36.67% compared to head (b8e958c) 36.67%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #735   +/-   ##
=======================================
  Coverage   36.67%   36.67%
=======================================
  Files         247      247
  Lines       26157    26157
=======================================
  Hits         9594     9594
  Misses      15518    15518
  Partials     1045     1045

Files Changed
Coverage Δ

pkg/config/model.go
34.45% <ø> (ø)

pkg/executor/redirect.go
3.75% <0.00%> (ø)

pkg/runtime/namespace/command.go
16.27% <0.00%> (ø)

pkg/config/misc.go
16.12% <40.00%> (ø)

pkg/boot/boot.go
45.66% <100.00%> (ø)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


Automated stress tests

based on GDELT, NYC TAXI, and other datasets
Easy to run

A brief list:

Write stress test - ingest a large dataset, using different schemas.  Check that all the data from the source is in the FiloDB table.
Time series / combo write and read test.  Check that data can be continually ingested and latest data can be queried.
Read stress test - combine short, single-partition reads with multi partition reads and whole table scans.  Check for concurrency.
In-memory concurrent test - check for high QPS.

This has been completed and merged.


Need help to solve the Parallax problem

How to move left/right when scroll vertical in the parallax.

Please ask in our Spectrum community here.
Consider making a CodeSandbox demonstrating what you've tried.


Variable created in kernels in JIT

Variables that are created in kernels are automatically set-up to float in the JIT code generator.
But if such variable is an integer, we would like to preserve this property.

Here is an example of an kernel not correctly interpreted by JIT:
    def kernel(particle, fieldset, time):
        i = 1
        while i < 4:
            print("Testing i:  %f" % i)
            i = i+1

I would have liked i to be defined as an integer.

But such issue is not a priority, since it only occurs in very specific occasions and can be easily circumvented (for example here with a < in the while test).
Let's close it for now.


Unhandled Exception: RangeError: Not enough bytes available.

Restarted application in 6,661ms.
W/DynamiteModule(20626): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(20626): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(20626): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.

Again Facing this issue in flutter web. Can't able to resolve it.
Error: RangeError: Not enough bytes available.
    at Object.throw_ [as throw] (http://localhost:64762/dart_sdk.js:4332:11)
    at binary_reader_impl.BinaryReaderImpl.new.[_requireBytes] (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1243:19)
    at binary_reader_impl.BinaryReaderImpl.new.readByte (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1252:26)
    at http://localhost:64762/packages/website/Models/User_model.dart.lib.js:437:28
    at User_model.UserDataAdapter.new.read (http://localhost:64762/packages/website/Models/User_model.dart.lib.js:439:9)
    at binary_reader_impl.BinaryReaderImpl.new.read (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1501:35)
    at storage_backend_js.StorageBackendJs.new.decodeValue (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1628:27)
    at MappedListIterable.new.elementAt (http://localhost:64762/dart_sdk.js:21547:25)
    at ListIterator.new.moveNext (http://localhost:64762/dart_sdk.js:21341:55)
    at JsIterator.next (http://localhost:64762/dart_sdk.js:5999:21)
    at storage_backend_js.StorageBackendJs.new.initialize (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1685:20)
    at initialize.next (<anonymous>)
    at http://localhost:64762/dart_sdk.js:37592:33
    at _RootZone.runUnary (http://localhost:64762/dart_sdk.js:37446:58)
    at _FutureListener.thenAwait.handleValue (http://localhost:64762/dart_sdk.js:32430:29)
    at handleValueCallback (http://localhost:64762/dart_sdk.js:32977:49)
    at Function._propagateToListeners (http://localhost:64762/dart_sdk.js:33015:17)
    at _Future.new.[_completeWithValue] (http://localhost:64762/dart_sdk.js:32858:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:64762/dart_sdk.js:32880:35)
    at Object._microtaskLoop (http://localhost:64762/dart_sdk.js:37707:13)
    at _startMicrotaskLoop (http://localhost:64762/dart_sdk.js:37713:13)
    at http://localhost:64762/dart_sdk.js:33232:9
Error: RangeError: Not enough bytes available.
    at Object.throw_ [as throw] (http://localhost:64762/dart_sdk.js:4332:11)
    at binary_reader_impl.BinaryReaderImpl.new.[_requireBytes] (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1243:19)
    at binary_reader_impl.BinaryReaderImpl.new.readByte (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1252:26)
    at http://localhost:64762/packages/website/Models/User_model.dart.lib.js:437:28
    at User_model.UserDataAdapter.new.read (http://localhost:64762/packages/website/Models/User_model.dart.lib.js:439:9)
    at binary_reader_impl.BinaryReaderImpl.new.read (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1501:35)
    at storage_backend_js.StorageBackendJs.new.decodeValue (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1628:27)
    at MappedListIterable.new.elementAt (http://localhost:64762/dart_sdk.js:21547:25)
    at ListIterator.new.moveNext (http://localhost:64762/dart_sdk.js:21341:55)
    at JsIterator.next (http://localhost:64762/dart_sdk.js:5999:21)
    at storage_backend_js.StorageBackendJs.new.initialize (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1685:20)
    at initialize.next (<anonymous>)
    at http://localhost:64762/dart_sdk.js:37592:33
    at _RootZone.runUnary (http://localhost:64762/dart_sdk.js:37446:58)
    at _FutureListener.thenAwait.handleValue (http://localhost:64762/dart_sdk.js:32430:29)
    at handleValueCallback (http://localhost:64762/dart_sdk.js:32977:49)
    at Function._propagateToListeners (http://localhost:64762/dart_sdk.js:33015:17)
    at _Future.new.[_completeWithValue] (http://localhost:64762/dart_sdk.js:32858:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:64762/dart_sdk.js:32880:35)
    at Object._microtaskLoop (http://localhost:64762/dart_sdk.js:37707:13)
    at _startMicrotaskLoop (http://localhost:64762/dart_sdk.js:37713:13)
    at http://localhost:64762/dart_sdk.js:33232:9
Restarted application in 250ms.
Prest :::::: 123871653
Error: RangeError: Not enough bytes available.
    at Object.throw_ [as throw] (http://localhost:64762/dart_sdk.js:4332:11)
    at binary_reader_impl.BinaryReaderImpl.new.[_requireBytes] (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1243:19)
    at binary_reader_impl.BinaryReaderImpl.new.readByte (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1252:26)
    at http://localhost:64762/packages/website/Models/User_model.dart.lib.js:437:28
    at User_model.UserDataAdapter.new.read (http://localhost:64762/packages/website/Models/User_model.dart.lib.js:439:9)
    at binary_reader_impl.BinaryReaderImpl.new.read (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1501:35)
    at storage_backend_js.StorageBackendJs.new.decodeValue (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1628:27)
    at MappedListIterable.new.elementAt (http://localhost:64762/dart_sdk.js:21547:25)
    at ListIterator.new.moveNext (http://localhost:64762/dart_sdk.js:21341:55)
    at JsIterator.next (http://localhost:64762/dart_sdk.js:5999:21)
    at storage_backend_js.StorageBackendJs.new.initialize (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1685:20)
    at initialize.next (<anonymous>)
    at http://localhost:64762/dart_sdk.js:37592:33
    at _RootZone.runUnary (http://localhost:64762/dart_sdk.js:37446:58)
    at _FutureListener.thenAwait.handleValue (http://localhost:64762/dart_sdk.js:32430:29)
    at handleValueCallback (http://localhost:64762/dart_sdk.js:32977:49)
    at Function._propagateToListeners (http://localhost:64762/dart_sdk.js:33015:17)
    at _Future.new.[_completeWithValue] (http://localhost:64762/dart_sdk.js:32858:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:64762/dart_sdk.js:32880:35)
    at Object._microtaskLoop (http://localhost:64762/dart_sdk.js:37707:13)
    at _startMicrotaskLoop (http://localhost:64762/dart_sdk.js:37713:13)
    at http://localhost:64762/dart_sdk.js:33232:9
Error: RangeError: Not enough bytes available.
    at Object.throw_ [as throw] (http://localhost:64762/dart_sdk.js:4332:11)
    at binary_reader_impl.BinaryReaderImpl.new.[_requireBytes] (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1243:19)
    at binary_reader_impl.BinaryReaderImpl.new.readByte (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1252:26)
    at http://localhost:64762/packages/website/Models/User_model.dart.lib.js:437:28
    at User_model.UserDataAdapter.new.read (http://localhost:64762/packages/website/Models/User_model.dart.lib.js:439:9)
    at binary_reader_impl.BinaryReaderImpl.new.read (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1501:35)
    at storage_backend_js.StorageBackendJs.new.decodeValue (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1628:27)
    at MappedListIterable.new.elementAt (http://localhost:64762/dart_sdk.js:21547:25)
    at ListIterator.new.moveNext (http://localhost:64762/dart_sdk.js:21341:55)
    at JsIterator.next (http://localhost:64762/dart_sdk.js:5999:21)
    at storage_backend_js.StorageBackendJs.new.initialize (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1685:20)
    at initialize.next (<anonymous>)
    at http://localhost:64762/dart_sdk.js:37592:33
    at _RootZone.runUnary (http://localhost:64762/dart_sdk.js:37446:58)
    at _FutureListener.thenAwait.handleValue (http://localhost:64762/dart_sdk.js:32430:29)
    at handleValueCallback (http://localhost:64762/dart_sdk.js:32977:49)
    at Function._propagateToListeners (http://localhost:64762/dart_sdk.js:33015:17)
    at _Future.new.[_completeWithValue] (http://localhost:64762/dart_sdk.js:32858:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:64762/dart_sdk.js:32880:35)
    at Object._microtaskLoop (http://localhost:64762/dart_sdk.js:37707:13)
    at _startMicrotaskLoop (http://localhost:64762/dart_sdk.js:37713:13)
    at http://localhost:64762/dart_sdk.js:33232:9
Restarted application in 8,586ms.
Restarted application in 725ms.
Prest :::::: 123871653
Prest :::::: 123871653
Error: RangeError: Not enough bytes available.
    at Object.throw_ [as throw] (http://localhost:64762/dart_sdk.js:4332:11)
    at binary_reader_impl.BinaryReaderImpl.new.[_requireBytes] (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1243:19)
    at binary_reader_impl.BinaryReaderImpl.new.readByte (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1252:26)
    at http://localhost:64762/packages/website/Models/User_model.dart.lib.js:437:28
    at User_model.UserDataAdapter.new.read (http://localhost:64762/packages/website/Models/User_model.dart.lib.js:439:9)
    at binary_reader_impl.BinaryReaderImpl.new.read (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1501:35)
    at storage_backend_js.StorageBackendJs.new.decodeValue (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1628:27)
    at MappedListIterable.new.elementAt (http://localhost:64762/dart_sdk.js:21547:25)
    at ListIterator.new.moveNext (http://localhost:64762/dart_sdk.js:21341:55)
    at JsIterator.next (http://localhost:64762/dart_sdk.js:5999:21)
    at storage_backend_js.StorageBackendJs.new.initialize (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1685:20)
    at initialize.next (<anonymous>)
    at http://localhost:64762/dart_sdk.js:37592:33
    at _RootZone.runUnary (http://localhost:64762/dart_sdk.js:37446:58)
    at _FutureListener.thenAwait.handleValue (http://localhost:64762/dart_sdk.js:32430:29)
    at handleValueCallback (http://localhost:64762/dart_sdk.js:32977:49)
    at Function._propagateToListeners (http://localhost:64762/dart_sdk.js:33015:17)
    at _Future.new.[_completeWithValue] (http://localhost:64762/dart_sdk.js:32858:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:64762/dart_sdk.js:32880:35)
    at Object._microtaskLoop (http://localhost:64762/dart_sdk.js:37707:13)
    at _startMicrotaskLoop (http://localhost:64762/dart_sdk.js:37713:13)
    at http://localhost:64762/dart_sdk.js:33232:9
Error: RangeError: Not enough bytes available.
    at Object.throw_ [as throw] (http://localhost:64762/dart_sdk.js:4332:11)
    at binary_reader_impl.BinaryReaderImpl.new.[_requireBytes] (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1243:19)
    at binary_reader_impl.BinaryReaderImpl.new.readByte (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1252:26)
    at http://localhost:64762/packages/website/Models/User_model.dart.lib.js:437:28
    at User_model.UserDataAdapter.new.read (http://localhost:64762/packages/website/Models/User_model.dart.lib.js:439:9)
    at binary_reader_impl.BinaryReaderImpl.new.read (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1501:35)
    at storage_backend_js.StorageBackendJs.new.decodeValue (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1628:27)
    at MappedListIterable.new.elementAt (http://localhost:64762/dart_sdk.js:21547:25)
    at ListIterator.new.moveNext (http://localhost:64762/dart_sdk.js:21341:55)
    at JsIterator.next (http://localhost:64762/dart_sdk.js:5999:21)
    at storage_backend_js.StorageBackendJs.new.initialize (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1685:20)
    at initialize.next (<anonymous>)
    at http://localhost:64762/dart_sdk.js:37592:33
    at _RootZone.runUnary (http://localhost:64762/dart_sdk.js:37446:58)
    at _FutureListener.thenAwait.handleValue (http://localhost:64762/dart_sdk.js:32430:29)
    at handleValueCallback (http://localhost:64762/dart_sdk.js:32977:49)
    at Function._propagateToListeners (http://localhost:64762/dart_sdk.js:33015:17)
    at _Future.new.[_completeWithValue] (http://localhost:64762/dart_sdk.js:32858:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:64762/dart_sdk.js:32880:35)
    at Object._microtaskLoop (http://localhost:64762/dart_sdk.js:37707:13)
    at _startMicrotaskLoop (http://localhost:64762/dart_sdk.js:37713:13)
    at http://localhost:64762/dart_sdk.js:33232:9
Restarted application in 6,495ms.
Prest :::::: 123871653
Error: RangeError: Not enough bytes available.
    at Object.throw_ [as throw] (http://localhost:64762/dart_sdk.js:4332:11)
    at binary_reader_impl.BinaryReaderImpl.new.[_requireBytes] (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1243:19)
    at binary_reader_impl.BinaryReaderImpl.new.readByte (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1252:26)
    at http://localhost:64762/packages/website/Models/User_model.dart.lib.js:437:28
    at User_model.UserDataAdapter.new.read (http://localhost:64762/packages/website/Models/User_model.dart.lib.js:439:9)
    at binary_reader_impl.BinaryReaderImpl.new.read (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1501:35)
    at storage_backend_js.StorageBackendJs.new.decodeValue (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1628:27)
    at MappedListIterable.new.elementAt (http://localhost:64762/dart_sdk.js:21547:25)
    at ListIterator.new.moveNext (http://localhost:64762/dart_sdk.js:21341:55)
    at JsIterator.next (http://localhost:64762/dart_sdk.js:5999:21)
    at storage_backend_js.StorageBackendJs.new.initialize (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1685:20)
    at initialize.next (<anonymous>)
    at http://localhost:64762/dart_sdk.js:37592:33
    at _RootZone.runUnary (http://localhost:64762/dart_sdk.js:37446:58)
    at _FutureListener.thenAwait.handleValue (http://localhost:64762/dart_sdk.js:32430:29)
    at handleValueCallback (http://localhost:64762/dart_sdk.js:32977:49)
    at Function._propagateToListeners (http://localhost:64762/dart_sdk.js:33015:17)
    at _Future.new.[_completeWithValue] (http://localhost:64762/dart_sdk.js:32858:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:64762/dart_sdk.js:32880:35)
    at Object._microtaskLoop (http://localhost:64762/dart_sdk.js:37707:13)
    at _startMicrotaskLoop (http://localhost:64762/dart_sdk.js:37713:13)
    at http://localhost:64762/dart_sdk.js:33232:9
Error: RangeError: Not enough bytes available.
    at Object.throw_ [as throw] (http://localhost:64762/dart_sdk.js:4332:11)
    at binary_reader_impl.BinaryReaderImpl.new.[_requireBytes] (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1243:19)
    at binary_reader_impl.BinaryReaderImpl.new.readByte (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1252:26)
    at http://localhost:64762/packages/website/Models/User_model.dart.lib.js:437:28
    at User_model.UserDataAdapter.new.read (http://localhost:64762/packages/website/Models/User_model.dart.lib.js:439:9)
    at binary_reader_impl.BinaryReaderImpl.new.read (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1501:35)
    at storage_backend_js.StorageBackendJs.new.decodeValue (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1628:27)
    at MappedListIterable.new.elementAt (http://localhost:64762/dart_sdk.js:21547:25)
    at ListIterator.new.moveNext (http://localhost:64762/dart_sdk.js:21341:55)
    at JsIterator.next (http://localhost:64762/dart_sdk.js:5999:21)
    at storage_backend_js.StorageBackendJs.new.initialize (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1685:20)
    at initialize.next (<anonymous>)
    at http://localhost:64762/dart_sdk.js:37592:33
    at _RootZone.runUnary (http://localhost:64762/dart_sdk.js:37446:58)
    at _FutureListener.thenAwait.handleValue (http://localhost:64762/dart_sdk.js:32430:29)
    at handleValueCallback (http://localhost:64762/dart_sdk.js:32977:49)
    at Function._propagateToListeners (http://localhost:64762/dart_sdk.js:33015:17)
    at _Future.new.[_completeWithValue] (http://localhost:64762/dart_sdk.js:32858:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:64762/dart_sdk.js:32880:35)
    at Object._microtaskLoop (http://localhost:64762/dart_sdk.js:37707:13)
    at _startMicrotaskLoop (http://localhost:64762/dart_sdk.js:37713:13)
    at http://localhost:64762/dart_sdk.js:33232:9
Restarted application in 753ms.
Prest :::::: 123871653
Error: RangeError: Not enough bytes available.
    at Object.throw_ [as throw] (http://localhost:64762/dart_sdk.js:4332:11)
    at binary_reader_impl.BinaryReaderImpl.new.[_requireBytes] (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1243:19)
    at binary_reader_impl.BinaryReaderImpl.new.readByte (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1252:26)
    at http://localhost:64762/packages/website/Models/User_model.dart.lib.js:437:28
    at User_model.UserDataAdapter.new.read (http://localhost:64762/packages/website/Models/User_model.dart.lib.js:439:9)
    at binary_reader_impl.BinaryReaderImpl.new.read (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1501:35)
    at storage_backend_js.StorageBackendJs.new.decodeValue (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1628:27)
    at MappedListIterable.new.elementAt (http://localhost:64762/dart_sdk.js:21547:25)
    at ListIterator.new.moveNext (http://localhost:64762/dart_sdk.js:21341:55)
    at JsIterator.next (http://localhost:64762/dart_sdk.js:5999:21)
    at storage_backend_js.StorageBackendJs.new.initialize (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1685:20)
    at initialize.next (<anonymous>)
    at http://localhost:64762/dart_sdk.js:37592:33
    at _RootZone.runUnary (http://localhost:64762/dart_sdk.js:37446:58)
    at _FutureListener.thenAwait.handleValue (http://localhost:64762/dart_sdk.js:32430:29)
    at handleValueCallback (http://localhost:64762/dart_sdk.js:32977:49)
    at Function._propagateToListeners (http://localhost:64762/dart_sdk.js:33015:17)
    at _Future.new.[_completeWithValue] (http://localhost:64762/dart_sdk.js:32858:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:64762/dart_sdk.js:32880:35)
    at Object._microtaskLoop (http://localhost:64762/dart_sdk.js:37707:13)
    at _startMicrotaskLoop (http://localhost:64762/dart_sdk.js:37713:13)
    at http://localhost:64762/dart_sdk.js:33232:9
Error: RangeError: Not enough bytes available.
    at Object.throw_ [as throw] (http://localhost:64762/dart_sdk.js:4332:11)
    at binary_reader_impl.BinaryReaderImpl.new.[_requireBytes] (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1243:19)
    at binary_reader_impl.BinaryReaderImpl.new.readByte (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1252:26)
    at http://localhost:64762/packages/website/Models/User_model.dart.lib.js:437:28
    at User_model.UserDataAdapter.new.read (http://localhost:64762/packages/website/Models/User_model.dart.lib.js:439:9)
    at binary_reader_impl.BinaryReaderImpl.new.read (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1501:35)
    at storage_backend_js.StorageBackendJs.new.decodeValue (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1628:27)
    at MappedListIterable.new.elementAt (http://localhost:64762/dart_sdk.js:21547:25)
    at ListIterator.new.moveNext (http://localhost:64762/dart_sdk.js:21341:55)
    at JsIterator.next (http://localhost:64762/dart_sdk.js:5999:21)
    at storage_backend_js.StorageBackendJs.new.initialize (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1685:20)
    at initialize.next (<anonymous>)
    at http://localhost:64762/dart_sdk.js:37592:33
    at _RootZone.runUnary (http://localhost:64762/dart_sdk.js:37446:58)
    at _FutureListener.thenAwait.handleValue (http://localhost:64762/dart_sdk.js:32430:29)
    at handleValueCallback (http://localhost:64762/dart_sdk.js:32977:49)
    at Function._propagateToListeners (http://localhost:64762/dart_sdk.js:33015:17)
    at _Future.new.[_completeWithValue] (http://localhost:64762/dart_sdk.js:32858:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:64762/dart_sdk.js:32880:35)
    at Object._microtaskLoop (http://localhost:64762/dart_sdk.js:37707:13)
    at _startMicrotaskLoop (http://localhost:64762/dart_sdk.js:37713:13)
    at http://localhost:64762/dart_sdk.js:33232:9
Restarted application in 278ms.
Prest :::::: 123871653
Error: RangeError: Not enough bytes available.
    at Object.throw_ [as throw] (http://localhost:64762/dart_sdk.js:4332:11)
    at binary_reader_impl.BinaryReaderImpl.new.[_requireBytes] (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1243:19)
    at binary_reader_impl.BinaryReaderImpl.new.readByte (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1252:26)
    at http://localhost:64762/packages/website/Models/User_model.dart.lib.js:437:28
    at User_model.UserDataAdapter.new.read (http://localhost:64762/packages/website/Models/User_model.dart.lib.js:439:9)
    at binary_reader_impl.BinaryReaderImpl.new.read (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1501:35)
    at storage_backend_js.StorageBackendJs.new.decodeValue (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1628:27)
    at MappedListIterable.new.elementAt (http://localhost:64762/dart_sdk.js:21547:25)
    at ListIterator.new.moveNext (http://localhost:64762/dart_sdk.js:21341:55)
    at JsIterator.next (http://localhost:64762/dart_sdk.js:5999:21)
    at storage_backend_js.StorageBackendJs.new.initialize (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1685:20)
    at initialize.next (<anonymous>)
    at http://localhost:64762/dart_sdk.js:37592:33
    at _RootZone.runUnary (http://localhost:64762/dart_sdk.js:37446:58)
    at _FutureListener.thenAwait.handleValue (http://localhost:64762/dart_sdk.js:32430:29)
    at handleValueCallback (http://localhost:64762/dart_sdk.js:32977:49)
    at Function._propagateToListeners (http://localhost:64762/dart_sdk.js:33015:17)
    at _Future.new.[_completeWithValue] (http://localhost:64762/dart_sdk.js:32858:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:64762/dart_sdk.js:32880:35)
    at Object._microtaskLoop (http://localhost:64762/dart_sdk.js:37707:13)
    at _startMicrotaskLoop (http://localhost:64762/dart_sdk.js:37713:13)
    at http://localhost:64762/dart_sdk.js:33232:9
Error: RangeError: Not enough bytes available.
    at Object.throw_ [as throw] (http://localhost:64762/dart_sdk.js:4332:11)
    at binary_reader_impl.BinaryReaderImpl.new.[_requireBytes] (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1243:19)
    at binary_reader_impl.BinaryReaderImpl.new.readByte (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1252:26)
    at http://localhost:64762/packages/website/Models/User_model.dart.lib.js:437:28
    at User_model.UserDataAdapter.new.read (http://localhost:64762/packages/website/Models/User_model.dart.lib.js:439:9)
    at binary_reader_impl.BinaryReaderImpl.new.read (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1501:35)
    at storage_backend_js.StorageBackendJs.new.decodeValue (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1628:27)
    at MappedListIterable.new.elementAt (http://localhost:64762/dart_sdk.js:21547:25)
    at ListIterator.new.moveNext (http://localhost:64762/dart_sdk.js:21341:55)
    at JsIterator.next (http://localhost:64762/dart_sdk.js:5999:21)
    at storage_backend_js.StorageBackendJs.new.initialize (http://localhost:64762/packages/hive/src/box/lazy_box_impl.dart.lib.js:1685:20)
    at initialize.next (<anonymous>)
    at http://localhost:64762/dart_sdk.js:37592:33
    at _RootZone.runUnary (http://localhost:64762/dart_sdk.js:37446:58)
    at _FutureListener.thenAwait.handleValue (http://localhost:64762/dart_sdk.js:32430:29)
    at handleValueCallback (http://localhost:64762/dart_sdk.js:32977:49)
    at Function._propagateToListeners (http://localhost:64762/dart_sdk.js:33015:17)
    at _Future.new.[_completeWithValue] (http://localhost:64762/dart_sdk.js:32858:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:64762/dart_sdk.js:32880:35)
    at Object._microtaskLoop (http://localhost:64762/dart_sdk.js:37707:13)
    at _startMicrotaskLoop (http://localhost:64762/dart_sdk.js:37713:13)
    at http://localhost:64762/dart_sdk.js:33232:9

Did the issue happened after changing model structure or randomly?

nope, it is working fine when i start debugging. after i restart 2-3 time. this error happens

First application start is ok, but second and all the next causes crash

First application start is ok, but second and all the next causes crash

Could you share code with us to identify cause?

when i clear all cache & storage and run builder again this issue is resolved

I call await StorageHive().init(); before main app class, for the first time is everything ok, but while opening app the second. etc times always error will be.
Method invokation
Place where error occurs
Link to Image error

[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: RangeError: Not enough bytes available.
any find the problem
#flutterhive

For several days I suffered with the same problem and could not understand why it appears. Changed package versions and much more.
Everything turned out to be trite.
I save the array of enams to the database.
I specified the type for enam (@HiveType), but did not specify the indices for the values (@HiveField), and this led to the fact that everything was successfully written to the database, but not read upon restarting!
This fixed my problem.

For several days I suffered with the same problem and could not understand why it appears. Changed package versions and much more.
Everything turned out to be trite.
I save the array of enams to the database.
I specified the type for enam (@HiveType), but did not specify the indices for the values (@HiveField), and this led to the fact that everything was successfully written to the database, but not read upon restarting!
This fixed my problem.

I figured it (atleast in my case).
This was my code:
  SessionTokenInfo read(BinaryReader reader) {
    print("read ${reader.readString()}");
    return SessionTokenInfo.fromJson(jsonDecode(reader.readString()));
  }

I was reading from the same BinaryReader twice. I assume there's a finite buffer that gets cleared as you read. Calling read twice (apparently) was the problem.
I hope this helps someone else.

I figured it (atleast in my case).
This was my code:
  SessionTokenInfo read(BinaryReader reader) {
    print("read ${reader.readString()}");
    return SessionTokenInfo.fromJson(jsonDecode(reader.readString()));
  }

I was reading from the same BinaryReader twice. I assume there's a finite buffer that gets cleared as you read. Calling read twice (apparently) was the problem.
I hope this helps someone else.

I figured it (atleast in my case).
This was my code:
  SessionTokenInfo read(BinaryReader reader) {
    print("read ${reader.readString()}");
    return SessionTokenInfo.fromJson(jsonDecode(reader.readString()));
  }

I was reading from the same BinaryReader twice. I assume there's a finite buffer that gets cleared as you read. Calling read twice (apparently) was the problem.
I hope this helps someone else.

I figured it (atleast in my case).
This was my code:
  SessionTokenInfo read(BinaryReader reader) {
    print("read ${reader.readString()}");
    return SessionTokenInfo.fromJson(jsonDecode(reader.readString()));
  }

I was reading from the same BinaryReader twice. I assume there's a finite buffer that gets cleared as you read. Calling read twice (apparently) was the problem.
I hope this helps someone else.

I figured it (atleast in my case).
This was my code:
  SessionTokenInfo read(BinaryReader reader) {
    print("read ${reader.readString()}");
    return SessionTokenInfo.fromJson(jsonDecode(reader.readString()));
  }

I was reading from the same BinaryReader twice. I assume there's a finite buffer that gets cleared as you read. Calling read twice (apparently) was the problem.
I hope this helps someone else.

reader.readString() moves cursor to end of the read data. So in your case second readString() will throw an error because there might be nothing available to read (Even if there's data, the returned data will not be same as you've printed).
Instead of reading twice you can store value in variable then use it twice.
  SessionTokenInfo read(BinaryReader reader) {
    final str = reader.readString();
    print('read $str');
    return SessionTokenInfo.fromJson(jsonDecode(str));
  }

I figured it (atleast in my case).
This was my code:
  SessionTokenInfo read(BinaryReader reader) {
    print("read ${reader.readString()}");
    return SessionTokenInfo.fromJson(jsonDecode(reader.readString()));
  }

I was reading from the same BinaryReader twice. I assume there's a finite buffer that gets cleared as you read. Calling read twice (apparently) was the problem.
I hope this helps someone else.

reader.readString() moves cursor to end of the read data. So in your case second readString() will throw an error because there might be nothing available to read (Even if there's data, the returned data will not be same as you've printed).
Instead of reading twice you can store value in variable then use it twice.
  SessionTokenInfo read(BinaryReader reader) {
    final str = reader.readString();
    print('read $str');
    return SessionTokenInfo.fromJson(jsonDecode(str));
  }

i occur the same problem,i did know what went wrong?

@HumesFork please proof-read your comment. The previous comment explain the issue clearly.
@leisim Maybe improve the error message? Seems a decent number of devs all find it unclear.

@cosmotek that's not so easy because there are a lot of reasons why this error may happen. Do you have a suggestion?

facing this issue using firestore. when i store firestore data locally and then restart my app. i get the following error -
[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: RangeError: Not enough bytes available.
#0      BinaryReaderImpl._requireBytes (package:hive/src/binary/binary_reader_impl.dart:49:7)
#1      BinaryReaderImpl.readByte (package:hive/src/binary/binary_reader_impl.dart:65:5)
#2      UserFSDataAdapter.read (package:fluent_life_flutter/db/model/user_model.g.dart:17:52)
#3      BinaryReaderImpl.read (package:hive/src/binary/binary_reader_impl.dart:325:33)
#4      BinaryReaderImpl.readFrame (package:hive/src/binary/binary_reader_impl.dart:273:26)
#5      FrameHelper.framesFromBytes (package:hive/src/binary/frame_helper.dart:17:26)
#6      FrameIoHelper.framesFromFile (package:hive/src/io/frame_io_helper.dart:41:12)

#7      StorageBackendVm.initialize (package:hive/src/backend/vm/storage_backend_vm.dart:82:30)

#8      BoxBaseImpl.initialize (package:hive/src/box/box_base_impl.dart:90:20)
#9      HiveImpl._openBox (package:hive/src/hive_impl.dart:106:22)

#10     HiveImpl.openBox (package:hive/src/hive_impl.dart:135:18)
#11     HiveProvider.openBox (package:fluent_life_flutter/db/hive_provider.dart:26:16)

#12     main (package:fluent_life_flutter/main.dart:15:22)

#13     _runMainZoned.. (dart:ui/hooks.dart:231:25)
#14     _rootRun (dart:async/zone.dart:1190:13)
#15     _CustomZone.run (dart:async/zone.dart:1093:19)
#16     _runZoned (dart:async/zone.dart:1630:10)
#17     runZonedGuarded (dart:async/zone.dart:1618:12)
#18     _runMainZoned. (dart:ui/hooks.dart:223:5)
#19     _startIsolate. (dart:isolate-patch/isolate_patch.dart:301:19)
#20     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: RangeError: Not enough bytes available.
#0      BinaryReaderImpl._requireBytes (package:hive/src/binary/binary_reader_impl.dart:49:7)
#1      BinaryReaderImpl.readByte (package:hive/src/binary/binary_reader_impl.dart:65:5)
#2      UserFSDataAdapter.read (package:fluent_life_flutter/db/model/user_model.g.dart:17:52)
#3      BinaryReaderImpl.read (package:hive/src/binary/binary_reader_impl.dart:325:33)
#4      BinaryReaderImpl.readFrame (package:hive/src/binary/binary_reader_impl.dart:273:26)
#5      FrameHelper.framesFromBytes (package:hive/src/binary/frame_helper.dart:17:26)
#6      FrameIoHelper.framesFromFile (package:hive/src/io/frame_io_helper.dart:41:12)

#7      StorageBackendVm.initialize (package:hive/src/backend/vm/storage_backend_vm.dart:82:30)

#8      BoxBaseImpl.initialize (package:hive/src/box/box_base_impl.dart:90:20)
#9      HiveImpl._openBox (package:hive/src/hive_impl.dart:106:22)

#10     HiveImpl.openBox (package:hive/src/hive_impl.dart:135:18)
#11     HiveProvider.openBox (package:fluent_life_flutter/db/hive_provider.dart:26:16)

#12     main (package:fluent_life_flutter/main.dart:15:22)

#13     _runMainZoned.. (dart:ui/hooks.dart:231:25)
#14     _rootRun (dart:async/zone.dart:1190:13)
#15     _CustomZone.run (dart:async/zone.dart:1093:19)
#16     _runZoned (dart:async/zone.dart:1630:10)
#17     runZonedGuarded (dart:async/zone.dart:1618:12)
#18     _runMainZoned. (dart:ui/hooks.dart:223:5)
#19     _startIsolate. (dart:isolate-patch/isolate_patch.dart:301:19)
#20     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

I had this exact same issue, in my case I created an adapter for the flutter math Point class which I used inside one of my business logic classes.
The adapter I first created was like this:
class PointAdapter extends TypeAdapter<Point> {
  @override
  final typeId = HiveUtils.POINT_TYPE_ID;

  @override
  Point read(BinaryReader reader) => Point(reader.read(0), reader.read(1));

  @override
  void write(BinaryWriter writer, Point obj) {
    writer
      ..writeByte(2)
      ..writeByte(0)
      ..write(obj.x)
      ..writeByte(1)
      ..write(obj.y);
  }
}

But the Point class is a flutter framework class and doesn't have @HiveField set for 'x' and 'y'... so the first time the app runs everything gets stored fine but after a hot restart the reader throws the RangeError exception.
Then I updated the adapter to this:
class PointAdapter extends TypeAdapter<Point> {
  @override
  final typeId = HiveUtils.POINT_TYPE_ID;

  @override
  Point read(BinaryReader reader) => Point(reader.readInt(), reader.readInt());

  @override
  void write(BinaryWriter writer, Point obj) {
    writer
      ..writeInt(obj.x)
      ..writeInt(obj.y);
  }
}

and everything works fine now.

This probably isn't the problem for everybody, but I was running into this error when I was writing null values in my adapter. I think it was throwing off the pointer.
What I THINK was happening was I was saving an index of an item with writeInt(), but sometimes my objects didn't have the index set yet, so it was writing null. Then when I was reading them back with readInt(), it reading my int value with wild results e.g. "-9038923489". Then the next read would result in this error because there were no terminating bytes for the String data it was trying to read.
I fixed this by changing my readInt() to just read() and my writeInt() to just write(). Not quite as clean, it'd be nice if there was some null handling built into those specific data type functions, but I can also do it on my end.

Well, that seems to be an important bug since when I change the structure of the hive class my users would have to reinstall the app....

Well, that seems to be an important bug since when I change the structure of the hive class my users would have to reinstall the app....

Not necessarily, you could change the @HiveField(...) index of each changed field in your class (by changing the field index you are ensuring a different type of an existing field to be properly stored)... also if you have had drastically changed your class or classes structure you could just change your box name and app will load a completely new box next time it starts.

Well, that seems to be an important bug since when I change the structure of the hive class my users have to reinstall the app....

It's a known feature (not a bug) of serialization in software engineering. You have to be careful when modifying serializers (aka: adapters in hive). It's not a bug because it's how object serializers works. Try modifying some bytes of an executable files in your operation system and try running it. It will be probably crashed because OS couldn't understand executable binary.
If you need dynamic schemes, I would suggest storing your data in json files or checking updating a class part of hive documentation.

I edited my comment to use better words. You made an excellent work and I really appreciate that. Thank you very much

I edited my comment to use better words. You made an excellent work and I really appreciate that. Thank you very much

I think you didn't get what I meant. You have to follow those rules to update classes safely - without requiring re-installation. If you don't follow them then the updated adapter would not deserialize previously written data and throw RangeError.

Don't change the field numbers for any existing fields.
If you add new fields, any objects written by the "old" adapter can still be read by the new adapter. These fields are just ignored. Similarly, objects written by your new code can be read by your old code: the new field is ignored when parsing.
Fields can be renamed and even changed from public to private or vice versa as long as the field number stays the same.
Fields can be removed, as long as the field number is not used again in your updated class.
Changing the type of a field is not supported. You should create a new one instead.

I've tried all solutions on this feed, none of those worked.
But I've found a solution in my case, maybe this will help others.
I've migrated my project to null safety, and before that Hive was working properly and this error never appears.
It's only after migrating my project + all the packages to null safety that the error appears.
I've to duplicate my project and try to find the error by elimination.
Here is what was causing the problem:
I have one object extending HiveObject, let's call it "Village".
Village has an instance of a class as a attribute, called "Person"
Person is an abstract class (BTW no need to put HiveType and HiveField for abstract classes, but you need to put them for classes that extend this abstract class).
One of the classes extending Person is intentionally empty. Let's call it "SubPerson":
@HiveType(typeId: 8)
class SubPerson extends Person {}

Well before migrating my project to null safety, build runner was generating adapters and the reader for SubPerson was like this:
  @override
  SubPerson read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return SubPerson();
  }

After migrating, build runner generated the same adapter but like this:
  @override
  SubPerson read(BinaryReader reader) {
    return SubPerson();
  }

The error was caused by this method.
I've manually changed the read method to the old one, and everything works now.
@TheMisir you should take a look at this

@leisim isn't Hive itself skipping to the next Frame if bytes have not read?

I removed read and write stubs for empty classes after this issue https://github.com/hivedb/hive/issues/638. I might have to look at Hive internals to check what's going on.

@RobinLbt what about the void write(BinaryWriter writer, SubPerson obj) method after migration? I mean... if the write method doesn't write anything to the  to the BinaryWriter then the migrated read should be fine as you posted… the problem would be if the writer writes something and the reader reads nothing... that way when the next object in your class tries to read it will not read the right byte...

@RobinLbt what about the void write(BinaryWriter writer, SubPerson obj) method after migration? I mean... if the write method doesn't write anything to the BinaryWriter then the migrated read should be fine as you posted… the problem would be if the writer writes something and the reader reads nothing... that way when the next object in your class tries to read it will not read the right byte...

Ah you're right. This issue will happen when you're using the model inside another model. Hadn't think that way.

I had this problem when changing the model shape (add new value). The data on disk still does not have the new value so it throw an error;
Workaround
extension HiveBinaryReaderExtension on BinaryReader {
  // Solve issue https://github.com/hivedb/hive/issues/424
  bool tryReadBool(bool defaultValue) {
    try {
      return readBool();
    } catch (e) {
      print(e);
    }
    return defaultValue;
  }
}

Hello, i have same issue. happened Android.

I created custom TypeAdapter for Decimal. I changed writer.write to writer.writeString and resolved it !!
class DecimalAdapter extends TypeAdapter<Decimal> {
  @override
  final typeId = hiveDecimalTypeId;

  @override
  Decimal read(BinaryReader reader) {
    final str = reader.readString();
    return Decimal.tryParse(str)!;
  }

  @override
  void write(BinaryWriter writer, Decimal obj) {
    // writer.write(obj.toString()); <----- this.
    writer.writeString(obj.toString());
  }
}

Same as @matsushitak very surprisingly, the method writer.write(xx) doesn't seem to handle rightly the given type. You have to use the specialized method or you will hit the RangeError mark.

Same as @matsushitak very surprisingly, the method writer.write(xx) doesn't seem to handle rightly the given type. You have to use the specialized method or you will hit the RangeError mark.

Well indeed, read/write and read$Type/write$Type does slightly different things. write(value) writes a byte representing type id of specific type before writing the data using write$Type method (you can set writeTypeId optional argument to false in order to disable this behavior). The written typeId byte is then used by read method to check which type is the following data and uses corresponding read$Type method to read the data.
The issues in your cases caused because you've written data using write() method which appends typeId before data bytes but, you've read that data using specific type reader (readString()) which doesn't relies on type id but instead understands written typeId value as part of length of the string (strings in hive encoded as length+bytes...) and then tries to read invalid amount of bytes, therefore throws RangeError.

Thank you for the explanation! I added a warning in the docs to help people with this possible culprit.

Just thinking, but it could be interesting to add a more complex scenario in the "manual adapter" chapter.
Especially how would you write a adapter with a complex object having another complex object as a property.

Thank you for the explanation! I added a warning in the docs to help people with this possible culprit.

Can you link where you put the warning?

Same as @matsushitak very surprisingly, the method writer.write(xx) doesn't seem to handle rightly the given type. You have to use the specialized method or you will hit the RangeError mark.

Well indeed, read/write and read$Type/write$Type does slightly different things. write(value) writes a byte representing type id of specific type before writing the data using write$Type method (you can set writeTypeId optional argument to false in order to disable this behavior). The written typeId byte is then used by read method to check which type is the following data and uses corresponding read$Type method to read the data.
The issues in your cases caused because you've written data using write() method which appends typeId before data bytes but, you've read that data using specific type reader (readString()) which doesn't relies on type id but instead understands written typeId value as part of length of the string (strings in hive encoded as length+bytes...) and then tries to read invalid amount of bytes, therefore throws RangeError.

Is there actually any reason why the behavior is different? And which is the preferred one for which use case?

Is there actually any reason why the behavior is different?

read and write methods used by hive itself for reading values because value type could be anything so this methods uses type ids to find out type of value so it can correctly deserialize it using specific writeType and readType methods.

And which is the preferred one for which use case?

read and write if you don't know runtime type of the value. But for custom adapters I would suggest using write$Type / read$Type methods as a kind of type safety measurement.

For me worked the following:
(Disclaimer: I'm using hive together with freezed case classes.)
Take a look at the Adapter implementation.
For me it looked like that.
 @override
  _$PersistenceServiceModelDrawerConfigOrientationNorth read(
      BinaryReader reader) {
    return _$PersistenceServiceModelDrawerConfigOrientationNorth();
  }

But it should have looked like that.
@override
  _$PersistenceServiceModelDrawerConfigOrientationNorth read(
      BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return _$PersistenceServiceModelDrawerConfigOrientationNorth();
  }

Solution
I had to add the json annotation method to the class. This made the generating of the correct adapters possible.
factory PersistenceServiceModelDrawerConfigOrientation.fromJson(
          Map<String, dynamic> json) =>
      _$PersistenceServiceModelDrawerConfigOrientationFromJson(json);

Hello, @anandsubbu007 @themisir I've also faced this issue when my one of the auto-generated model class (TypeAdapter) is modified manually and also when the original model class is modified and auto-generated classes are not generated again. So when I run the command flutter packages pub run build_runner build, all my auto-generated classes are regenerated and it solves the error Unhandled Exception: RangeError: Not enough bytes available.

Tanks @siddhantsatpute  this solution it's work for me

Fixed this problem yesterday with flutter packages pub run build_runner build
Problem returned the next morning. Spent a half day on this problem, after reading this similar issue - https://github.com/hivedb/hive/issues/943 - flutter clean fixed everything.

I am getting an error RangeError: Not enough bytes available for following execution
@HiveType(typeId: 20)
class Channel {
  @HiveField(0)
  final String id;
  @HiveField(1)
  final String mainBranch;
  @HiveField(2)
  final List<String> fieldsUpdatedBy;
  @HiveField(3)
  final String creator;
  @HiveField(4)
  final Fields fields;
  @HiveField(5)
  final DateTime createdAt;
  @HiveField(6)
  final ChannelStatus status;
  @HiveField(7)
  final Map<String, JsonInventory> inventory;
  @HiveField(8)
  final ChannelAttachment attachment;
  Channel(this.id,
      {required this.createdAt,
      required this.creator,
      required this.fields,
      required List<String> fieldsUpdatedBy,
      required this.mainBranch,
      required this.status,
      required Map<String, JsonInventory> inventory,
      required this.attachment})
      : inventory = Map.unmodifiable(inventory),
        fieldsUpdatedBy = List.unmodifiable(fieldsUpdatedBy);

  factory Channel.parse(id, data) {
    return Channel(
      id as String,
      createdAt: Timestamp.parse(data['createdAt']),
      creator: data['creator'] as String,
      fields: Fields.parse(data['fields']),
      fieldsUpdatedBy: <String>[...data['fieldsUpdatedBy']],
      mainBranch: data['mainBranch'] as String,
      status: ChannelStatus.parse(data['status']),
      attachment: ChannelAttachment.parse(data['attachment']),
      inventory: <dynamic, dynamic>{...data['inventory']}.map((key, value) => MapEntry(key as String, JsonInventory.parse(value))),
    );
  }
}

after generating adaptor code
class ChannelAdapter extends TypeAdapter<Channel> {
  @override
  final int typeId = 20;

  @override
  Channel read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return Channel(
      fields[0] as String,
      createdAt: fields[5] as DateTime,
      creator: fields[3] as String,
      fields: fields[4] as Fields,
      fieldsUpdatedBy: (fields[2] as List).cast<String>(),
      mainBranch: fields[1] as String,
      status: fields[6] as ChannelStatus,
      inventory: (fields[7] as Map).cast<String, JsonInventory>(),
      attachment: fields[8] as ChannelAttachment,
    );
  }

  @override
  void write(BinaryWriter writer, Channel obj) {
    writer
      ..writeByte(9)
      ..writeByte(0)
      ..write(obj.id)
      ..writeByte(1)
      ..write(obj.mainBranch)
      ..writeByte(2)
      ..write(obj.fieldsUpdatedBy)
      ..writeByte(3)
      ..write(obj.creator)
      ..writeByte(4)
      ..write(obj.fields)
      ..writeByte(5)
      ..write(obj.createdAt)
      ..writeByte(6)
      ..write(obj.status)
      ..writeByte(7)
      ..write(obj.inventory)
      ..writeByte(8)
      ..write(obj.attachment);
  }

  @override
  int get hashCode => typeId.hashCode;

  @override
  bool operator ==(Object other) => identical(this, other) || other is ChannelAdapter && runtimeType == other.runtimeType && typeId == other.typeId;
}

now when i try to read a channel instance from hive box it throws an error at i = 7 in following code
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };

at i = 7 the data must be JsonInventory, so here is the class
@HiveType(typeId: 3)
class JsonInventory {
  @HiveField(0)
  final Map<String, int> data;
  JsonInventory(Map<String, int> data) : data = Map.unmodifiable(data);
  const JsonInventory.zero() : data = const {};

  static JsonInventory parse(dynamic data) {
    return JsonInventory(<dynamic, dynamic>{...data}.cast<String, int>());
  }

  int operator [](String id) => data[id] ?? 0;

  static JsonInventory total(Iterable<JsonInventory> inventories) {
    if (inventories.isEmpty) return const JsonInventory.zero();
    if (inventories.length == 1) return inventories.first;
    final newData = <String, int>{};
    for (var inventory in inventories) {
      for (var entry in inventory.data.entries) {
        newData[entry.key] = (newData[entry.key] ?? 0) + entry.value;
      }
    }
    return JsonInventory(newData);
  }

  JsonInventory operator -() {
    final newData = <String, int>{};
    for (var entry in data.entries) {
      newData[entry.key] = -entry.value;
    }
    return JsonInventory(newData);
  }
}

is this happening because data is very deeply nested?
channel > Map<String, JsonInventory> (.inventory) > Map<String, int> (.data)
seems like 3 or 4 level deep, but shouldn't  write & read be able to manage this automatically using recursive process?
any way there are other class in same project that work fine & there are other class instances in same Hive.box and they are read alright, problem is only in reading this Channel class.

I got the same error.
but every time I re run the app.

this issue is solved when i delete local data.

I have the same problem. Each time I have to delete the local data. Have you managed to find a solution?

i am facing same issue not solve yet .
check many article and solution but still same .

Error: RangeError: Not enough bytes available.
due to this error package is useless for me .

I faced the same issue when using new sealed classes, or more specifically empty classes.
Assuming the following hierarchy:
sealed class A {
  const A();
}

@HiveType(typeId: 3)
class B extends A {
  const B();
}

@HiveType(typeId: 2)
class C extends A {
  final int field;
  const C(this.field)
}

The generated adapters for the empty class (here B) currently implement the read method as follows:
B read(BinaryReader reader) {
  return B();
}

However, the code should look as follows:
B read(BinaryReader reader) {
  reader.readyByte(); // Consume written byte
  return B();
}

Notice the added line reader.readByte(). This seems to be necessary since the write method writes a single byte (writer.writeByte(0)). By not "consuming" this written byte, the offsets seem to mismatch in following iterations.
This issue may also occur in other cases when the constructor parameters are not empty. There is also another issue #1081 which may be related.

I am getting the same error while launching the app second time. Any fix for this


Add events for each section of the Edit mode in Matomo

What

Add events for each section of the Edit mode in Matomo
Opening Individual Editing sections - and Clicking save as well, to see how many people give up

Part of

#2855

This can be done with our existing package  right @M123-dev
I can have a look at this

Yes, everything should be in place in the analytics helper

Isn't it fixed ? @M123-dev @AshAman999

Its fixed