[firebase_database] Web support for realtime database

Description
This PR will add support to realtime database for Web
Related Issues
https://github.com/flutter/flutter/issues/48542
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

[x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
[x] If the pull request affects only one plugin, the PR title starts with the name of the plugin in brackets (e.g. [cloud_firestore])
[ ] My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
[ ] All existing and new tests are passing.
[x] I updated/added relevant documentation (doc comments with ///).
[x] The analyzer (flutter analyze) does not report any problems on my PR.
[x] I read and followed the Flutter Style Guide.
[x] I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
[x] I updated CHANGELOG.md to add a description of the change.
[x] I signed the CLA.
[x] I am willing to follow-up on review comments in a timely manner.

Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?

[ ] Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
[x] No, this is not a breaking change.

Any progress as to the addition of web support for database?

We are waiting for this!

Will this be done soon ?
Does anyone have a work around ?

Sorry for disappearing. I was super busy at work. The current progress of the task is
The interface has been built and works fine on mobile but on the web, the referencing is getting overlapped. It's quite complicated for me to have a look and fix it with very little spare time.
If any of you guys wanna share hand then please let me know, let's get this done together,

@googlebot I signed it.

@googlebot I fixed it.

@googlebot I signed it!

@googlebot I fixed it.

@googlebot I signed it!

@googlebot I consent.

Any reason this PR cannot be merged?

Because of its a work in progress @jackyq2015

@collinjackson @kroikie @bean5 Hi guys, I am getting very near to the finish line and I don't think this PR will ever make sense to be review as its a very big change on a single thread. I would like to get a bit of advice, will it be better if I sent the multiple separate PRs one by one or should I continue on this one?
Also here was my plan for the breakdown of this PR

Move firebase_messaging to firebase_messaging/firebase_messaging
Add platform interface package
Migrate to platform interface
Add database web plugin
Add web plugin to firebase_database dependencies
Update example
Update README

i hope this PR will be merged soon.. :)

Any updates on the PR?

@collinjackson @kroikie @bean5 Hi guys, I am getting very near to the finish line and I don't think this PR will ever make sense to be reviewed as its a very big change on a single thread. I would like to get a bit of advice, will it be better if I sent the multiple separate PRs one by one or should I continue on this one?
Also here was my plan for the breakdown of this PR
Move firebase_messaging to firebase_messaging/firebase_messaging
Add platform interface package
Migrate to platform interface
Add database web plugin
Add web plugin to firebase_database dependencies
Update example
Update README
Let me know if any change is needed.

Hey @awazgyawali! There's value on having a PR with the whole code, so people can clone it and apply it to their apps. We used this with cloud_firestore and it was invaluable. However:
You should move firebase_database to firebase_database/firebase_database ASAP, in a separate PR. That one is very quick to do, and it'd make the rest of your PRs a little bit simpler.
Then you can have one big PR (could be this one) where you display the finished PoC for manual verification. When we did this for cloud_firestore, I had a local, silly app that tested as many features as possible as a local testbed. For firestore database, a mix of this and this could be enough! The example app of firebase_database may be another good candidate for this.
This is the PR that receives the most scrutiny, and where most of the work happens, with everything integrated so it continues to be testable. All verification tests should pass, except for the "publishable" one, because of the "path" dependencies across the three plugins.
Once we're all happy with the PR, then you can do 3 (simple again) PRs, where you split the codebase of this one into 3 next PRs:

Add (and publish) the platform interface plugin
Migrate the core plugin to the platform interface implementation, and remove old code.
Introduce (and publish) the web plugin.

Now all that is left is updating the core package to use the web version automatically, and update the example app so it supports web (normally, adding a web/index.html, and removing usages of dart:io, if any :P)

Thanks for the detailed explanation @ditman.

You should move firebase_database to firebase_database/firebase_database ASAP, in a separate PR.
I'll send the PR ASAP.

The example app of firebase_database may be another good candidate for this.
I have added all the possible features running on android, ios, and web on the example app as well. So that part should be good to go as well.

... everything integrated so it continues to be testable. All verification tests should pass, except for the "publishable" one, because of the "path" dependencies across the three plugins.
Ok, I'll make sure of that in a couple of days.

Once I finish all the above tasks, ill get back to the thread for further discussion.

Thanks for your contribution @awazgyawali!!

We'll provide an update later on this week on how we can move this PR forwards and what we can do to help - if necessary.
Please hold of any substantial work until then, thanks 👍

Thanks @Salakar!

Hi, I would love to use this plugin In my project these days. Do we have some movements here? Maybe some help needed?

We'll use this PR as the base to work on database, as part of https://github.com/FirebaseExtended/flutterfire/issues/2582 - it's a great PR, however we need to ensure that it's fully tested and covered API review wise before we can merge.

Hi, @Ehesp I just went through the Roadmap and it looks really promising. This PR is not finalized in terms of testing as no new test cases have been written for the web platform but as of my manual testing, everything seems to work fine without any breaking changes. This PR doesn't have support for runTransaction method on the web as it's not supported by the underlying firebase plugin.
But right now, I am waiting for @Salakar for his comment on this before I start working on the points made by @ditman (https://github.com/FirebaseExtended/flutterfire/pull/1835#issuecomment-630336875)
I have mentioned everyone here so that we all are synced up with the current status of the PR.
Thanks!!!!

Can you guys please suggest, how to apply this PR to my project before it will be released? I spend a couple of hours trying to do this, but there are errors. Is there a command to do this?

Can you guys please suggest, how to apply this PR to my project before it will be released? I spend a couple of hours trying to do this, but there are errors. Is there a command to do this?

Clone the repo somewhere near to your project, and reference it as follows:
firebase_database:
    path: ../{to the folder where the repo is}/firebase_database/firebase_database

I myself have not done it but should work.

Hi @awazgyawali, first of all let me congratulate you on the great work done so far!
I had some free time and I tried adding your repository to my existing flutter application that uses firebase_database. After resolving some easy to fix conflicts, I am now getting this error:
Error: MissingPluginException(No implementation found for method Query#observe on channel plugins.flutter.io/firebase_database)
I also get a bunch of messages like this:
Overflow on channel: plugins.flutter.io/firebase_database.  Messages on this channel are being discarded in FIFO fashion.  The engine may not be running or you need to adjust the buffer size if of the channel.
Any idea what can be done here?

@byrek3d Sorry to hear that it didn't work on your project. Its been around about a month since I last worked on this PR. From what I remember, everything except runTransaction was working. Can you share me your query which caused this issue so that I can look into it easily?

I would if I could, but the error message really doesn't help narrow it down to what piece of code is causing this. I tried debugging by using simple prints, and my best guess is that it comes from this piece of code:
   _clientQuery = database.reference().child("client");     _onClientAddedSubscription =         _clientQuery.onChildAdded.listen(_onEntryAdded);     _onClientChangedSubscription =         _clientQuery.onChildChanged.listen(_onEntryChanged);     _onClientRemovedSubscription =         _clientQuery.onChildRemoved.listen(_onEntryRemoved);

@byrek3d if you're getting MethodChannel errors, it's because your version of the plugin may not be using the platform_interface package that @awazgyawali added here (or that it is not 100% complete)
Regards!

@byrek3d  I checked the PR back again yesterday. It's working fine for me. I don't know if it's because of Flutter version mismatch. But I would be more than grateful if you tried running the example project that comes along with the repo.

I tested this PR for a week now, and all works great in my project! Thanks for this work.

Amazing to hear @1g0rrr  Is there any issue or missing features that you might have encountered except runTransaction.

@1g0rrr May I ask what changes you made to your current project in oder to get it to run? I added these two in my pubsec.yaml
  firebase_database:     path: ../../../database_web_cloning/flutterfire/packages/firebase_database/firebase_database   firebase_database_web:     path: ../../../database_web_cloning/flutterfire/packages/firebase_database/firebase_database_web
But now I can't run on the simulator anymore (pod install error) and when I run on the web I get this error:
TypeError: dart.global.firebase.database is not a function

Here is how I managed to do this. I copy the whole PR repo, and then deleted unnecessary folders.

Working great on my end as well. I was able to produce a crash on android chrome when using many subscriptions combined with scroll. Is there a suggested maximum number of subscriptions? Doesn't seem to require the event to actually trigger, it's just the presence of a large amount of subscriptions that seems to cause the instability.

Has anyone tested .onDisconnect()? I cannot get a set or a remove operation to complete after the window is closed.

@collinjackson @kroikie @bean5 Hi guys, I am getting very near to the finish line and I don't think this PR will ever make sense to be reviewed as its a very big change on a single thread. I would like to get a bit of advice, will it be better if I sent the multiple separate PRs one by one or should I continue on this one?
Also here was my plan for the breakdown of this PR
Move firebase_messaging to firebase_messaging/firebase_messaging
Add platform interface package
Migrate to platform interface
Add database web plugin
Add web plugin to firebase_database dependencies
Update example
Update README
Let me know if any change is needed.

Hey @awazgyawali! There's value on having a PR with the whole code, so people can clone it and apply it to their apps. We used this with cloud_firestore and it was invaluable. However:
You should move firebase_database to firebase_database/firebase_database ASAP, in a separate PR. That one is very quick to do, and it'd make the rest of your PRs a little bit simpler.
Then you can have one big PR (could be this one) where you display the finished PoC for manual verification. When we did this for cloud_firestore, I had a local, silly app that tested as many features as possible as a local testbed. For firestore database, a mix of this and this could be enough! The example app of firebase_database may be another good candidate for this.
This is the PR that receives the most scrutiny, and where most of the work happens, with everything integrated so it continues to be testable. All verification tests should pass, except for the "publishable" one, because of the "path" dependencies across the three plugins.
Once we're all happy with the PR, then you can do 3 (simple again) PRs, where you split the codebase of this one into 3 next PRs:

Add (and publish) the platform interface plugin
Migrate the core plugin to the platform interface implementation, and remove old code.
Introduce (and publish) the web plugin.

Now all that is left is updating the core package to use the web version automatically, and update the example app so it supports web (normally, adding a web/index.html, and removing usages of dart:io, if any :P)
/PS: Paging @Ehesp for assistance with this big, big change!

I think it's now time to move ahead as a lot of fellow developers are waiting on this. I will start the breakdown process from tomorrow. I hope it gets reviewed soon.

The first PR has landed.
https://github.com/FirebaseExtended/flutterfire/pull/2852

Don't mean to give any hurry but my project is heavily relying on this, any idea on when this will be merged? I'm happy to offer help if needed!

@dev-mush I setup a fork that allows you to easily add this to your pubspec while we wait for a PR.
    git:
      url: https://github.com/MichealReed/flutterfire
      ref: realtime_database_web_support
      path: packages/firebase_database/firebase_database
  firebase_database_web:
    git:
      url: https://github.com/MichealReed/flutterfire
      ref: realtime_database_web_support
      path: packages/firebase_database/firebase_database_web```

Hi everyone! Last time I was reporting some errors in my project, but I am now certain that it was just my bad when modifying the pubsec.yaml
Using what @MichealReed provided was much simpler and worked like a charm.
Now my app is partially working on the web, I can see that it reads a list of objects from my firebase database correctly, but when trying to access another list of objects from my database (that's what my app normally does, it's a list of "people" each having different "files") it is crashing.
I really can't figure out how to debug on firebase_web, but here is the error output i get:
`══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following assertion was thrown building Builder:
Assertion failed:
file:///Users/gerald/Workspaces/FlutterProjects/flutter/.pub-cache/git/flutterfire-4bff36815227cf9b064bf21bf5e2a777ce43de83/packages/firebase_database/firebase_database_platform_interface/lib/src/platform_interface/query.dart:27:16
database != null
is not true
The relevant error-causing widget was:
MaterialApp
file:///Users/gerald/Workspaces/FlutterProjects/clone_web_test/TimeSheet/time_sheet/lib/main.dart:17:13
When the exception was thrown, this was the stack:
dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 214:49           throw
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 24:3             assertFailed
packages/firebase_database_platform_interface/src/platform_interface/query.dart 27:24  new
packages/firebase_database_web/src/query_web.dart 15:3                                 new
packages/firebase_database_web/src/database_reference_web.dart 91:12                   orderByChild
packages/firebase_database/src/query.dart 106:28                                       orderByChild
packages/time_sheet/pages/files_page.dart 63:10                                        initState
packages/flutter/src/widgets/framework.dart 4649:58                                    [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 5839:14                                    mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4490:5                                     [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 5839:14                                    mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 5839:14                                    mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4684:11                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4490:5                                     [_firstBuild]
packages/flutter/src/widgets/framework.dart 4675:11                                    [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 5956:32                                    mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4684:11                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4490:5                                     [_firstBuild]
packages/flutter/src/widgets/framework.dart 4675:11                                    [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 5839:14                                    mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4684:11                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4490:5                                     [_firstBuild]
packages/flutter/src/widgets/framework.dart 4675:11                                    [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 5839:14                                    mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4684:11                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4490:5                                     [_firstBuild]
packages/flutter/src/widgets/framework.dart 4675:11                                    [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 5839:14                                    mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4684:11                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4490:5                                     [_firstBuild]
packages/flutter/src/widgets/framework.dart 4675:11                                    [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4490:5                                     [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4684:11                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4490:5                                     [_firstBuild]
packages/flutter/src/widgets/framework.dart 4675:11                                    [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 5839:14                                    mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4490:5                                     [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 5839:14                                    mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4684:11                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4490:5                                     [_firstBuild]
packages/flutter/src/widgets/framework.dart 4675:11                                    [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4490:5                                     [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 5839:14                                    mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4490:5                                     [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4684:11                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4490:5                                     [_firstBuild]
packages/flutter/src/widgets/framework.dart 4675:11                                    [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4490:5                                     [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4490:5                                     [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4684:11                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4490:5                                     [_firstBuild]
packages/flutter/src/widgets/framework.dart 4675:11                                    [_firstBuild]
packages/flutter/src/widgets/framework.dart 4485:5                                     mount
packages/flutter/src/widgets/framework.dart 3455:13                                    inflateWidget
packages/flutter/src/widgets/framework.dart 3223:18                                    updateChild
packages/flutter/src/widgets/framework.dart 5589:32                                    updateChildren
packages/flutter/src/widgets/framework.dart 5966:17                                    update
packages/flutter/src/widgets/framework.dart 3210:14                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4684:11                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4716:5                                     update
packages/flutter/src/widgets/framework.dart 3210:14                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4871:5                                     update
packages/flutter/src/widgets/inherited_notifier.dart 181:11                            update
packages/flutter/src/widgets/framework.dart 3210:14                                    updateChild
packages/flutter/src/widgets/framework.dart 5846:14                                    update
packages/flutter/src/widgets/framework.dart 3210:14                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4684:11                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4716:5                                     update
packages/flutter/src/widgets/framework.dart 3210:14                                    updateChild
packages/flutter/src/widgets/framework.dart 5846:14                                    update
packages/flutter/src/widgets/framework.dart 3210:14                                    updateChild
packages/flutter/src/widgets/framework.dart 5846:14                                    update
packages/flutter/src/widgets/framework.dart 3210:14                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 4592:5                                     update
packages/flutter/src/widgets/framework.dart 3210:14                                    updateChild
packages/flutter/src/widgets/framework.dart 4536:16                                    performRebuild
packages/flutter/src/widgets/framework.dart 4684:11                                    performRebuild
packages/flutter/src/widgets/framework.dart 4227:5                                     rebuild
packages/flutter/src/widgets/framework.dart 2632:31                                    buildScope
packages/flutter/src/widgets/binding.dart 864:20                                       drawFrame
packages/flutter/src/rendering/binding.dart 284:5                                      [_handlePersistentFrameCallback]
packages/flutter/src/scheduler/binding.dart 1113:15                                    [_invokeFrameCallback]
packages/flutter/src/scheduler/binding.dart 1052:9                                     handleDrawFrame
packages/flutter/src/scheduler/binding.dart 968:5                                      [_handleDrawFrame]
lib/_engine/engine/window.dart 725:13                                                  _invoke
lib/_engine/engine/window.dart 338:5                                                   invokeOnDrawFrame
lib/_engine/engine.dart 213:18
════════════════════════════════════════════════════════════════════════════════════════════════════`

@byrek3d Can you post a minimal reproducible code.
Also as #2582 is moving hot and I will not probably maintain this PR until firebase_core changes are stable.

@Salakar I don't see any status report for Realtime Database on the Flutterfire road map issue #2582. Has the refactor for Realtime database been ditched?

@Salakar I don't see any status report for Realtime Database on the Flutterfire road map issue #2582. Has the refactor for Realtime database been ditched?

Not ditched, shifted to early next year, as mentioned on the Roadmap we're looping back to polish off the web implementation on all the plugins we reworked for native, so Web is definitely still getting attention.

firebase_database:
git:
url: https://github.com/MichealReed/flutterfire
ref: realtime_database_web_support
path: packages/firebase_database/firebase_database
firebase_database_web:
git:
url: https://github.com/MichealReed/flutterfire
ref: realtime_database_web_support
path: packages/firebase_database/firebase_database_web

Getting error
Error on line 37, column 5 of pubspec.yaml: A dependency may only have one source.
╷
37 │ ┌     git:
38 │ │       url: https://github.com/MichealReed/flutterfire
39 │ │       ref: realtime_database_web_support
40 │ │       path: packages/firebase_database/firebase_database
41 │ │     firebase_database_web:
42 │ │       git:
43 │ │         url: https://github.com/MichealReed/flutterfire
44 │ │         ref: realtime_database_web_support
45 │ │         path: packages/firebase_database/firebase_database_web
46 │ │   flutter_speed_dial: ^1.2.5
│ └──^
╵
pub get failed (65;    ╵)

@dev-mush I setup a fork that allows you to easily add this to your pubspec while we wait for a PR.
firebase_database:
    git:
      url: https://github.com/MichealReed/flutterfire
      ref: realtime_database_web_support
      path: packages/firebase_database/firebase_database
  firebase_database_web:
    git:
      url: https://github.com/MichealReed/flutterfire
      ref: realtime_database_web_support
      path: packages/firebase_database/firebase_database_web```

Ok what are the next steps after importing dependencies ? How do we use this in dart file ?

@byrek3d Can you post a minimal reproducible code. As per thr error message an assertion on this line is failing
/firebase_database/firebase_database_platform_interface/lib/src/platform_interface/query.dart:27:16
Also as #2582 is moving hot and I will not probably maintain this PR until firebase_core changes are stable.

I'm also getting some exception can you tell me what's wrong
Error: Assertion failed: file:///Users/sysquare/development/flutter/.pub-cache/git/flutterfire-4bff36815227cf9b064bf21bf5e2a777ce43de83/packages/firebase_database/firebase_database_platform_interface/lib/src/platform_interface/query.dart:27:16
            database != null
            is not true
                at Object.throw_ [as throw] (http://localhost:55510/dart_sdk.js:4338:11)
                at Object.assertFailed (http://localhost:55510/dart_sdk.js:4281:15)
                at firebase_database_web.QueryWeb.new.firebase_database_platform_interface.QueryPlatform.new (http://localhost:55510/packages/firebase_database_platform_interface/firebase_database_platform_interface.dart.lib.js:331:35)
                at new firebase_database_web.QueryWeb.new (http://localhost:55510/packages/firebase_database_web/firebase_database_web.dart.lib.js:405:50)
                at firebase_database_web.DatabaseReferenceWeb.new.orderByChild (http://localhost:55510/packages/firebase_database_web/firebase_database_web.dart.lib.js:203:14)
                at firebase_database.DatabaseReference.__.orderByChild (http://localhost:55510/packages/firebase_database/firebase_database.dart.lib.js:106:71)
                at WSFirebaseServices.FireBaseStorage.new.getUserByEmail (http://localhost:55510/packages/WoodStock/Services/WSFirebaseServices.dart.lib.js:90:74)
                at getUserByEmail.next (<anonymous>)
                at runBody (http://localhost:55510/dart_sdk.js:37922:34)
                at Object._async [as async] (http://localhost:55510/dart_sdk.js:37953:7)
                at WSFirebaseServices.FireBaseStorage.new.getUserByEmail (http://localhost:55510/packages/WoodStock/Services/WSFirebaseServices.dart.lib.js:89:20)
                at WSLoginController.MyCustomFormState.new.login (http://localhost:55510/packages/WoodStock/WSDashboardPage.dart.lib.js:4413:37)
                at login.next (<anonymous>)
                at http://localhost:55510/dart_sdk.js:37902:33
                at _RootZone.runUnary (http://localhost:55510/dart_sdk.js:37756:58)
                at _FutureListener.thenAwait.handleValue (http://localhost:55510/dart_sdk.js:32717:29)
                at handleValueCallback (http://localhost:55510/dart_sdk.js:33265:49)
                at Function._propagateToListeners (http://localhost:55510/dart_sdk.js:33303:17)
                at _Future.new.[_completeWithValue] (http://localhost:55510/dart_sdk.js:33145:23)
                at async._AsyncCallbackEntry.new.callback (http://localhost:55510/dart_sdk.js:33168:35)
                at Object._microtaskLoop (http://localhost:55510/dart_sdk.js:38017:13)
                at _startMicrotaskLoop (http://localhost:55510/dart_sdk.js:38023:13)
                at http://localhost:55510/dart_sdk.js:33520:9

Can this PR get some love again now that firebase_core is stable?

I would love to have some official update on this, or at least some kind of mention of it on the roadmap.
The way it is right now, is quite hard to have any ideia of the status of this.

Hey all, I created and merged https://github.com/FirebaseExtended/flutterfire/pull/5887 a few days ago which moves packages/firebase_database to packages/firebase_database/firebase_database in the repository - which is a good start to be able to start taking PRs for Database web support.
This PR itself is so far out of date (not the authors fault) that I don't think we can move forward with this one, there's been significant restructures, CI changes and updates happening across the repository. That said I don't think we should just discard the work that's happened here.
If contributors are willing I'd like to propose the following;

A separate PR to improve integration test coverage, it's historically been pretty bare; I wouldn't feel comfortable shipping or reviewing the significant changes that 2 & 3 would require without first improving our integration tests coverage.
Using this PR as a reference; a separate PR to federate the firebase_database plugin and implement the firebase_database_platform_interface package. Depends on 1.
Using this PR as a reference; a separate PR to implement web support (firebase_database_web). Depends on 1 & 2.

Whilst firebase_database isn't currently a package officially in our scope (@invertase) right now, we're still willing to help see the above contributions through to merging if people are willing. Historically PRs may have sat and become stale, but this is no longer the case now (we've shipped almost 100 PRs in the last month) - so there hopefully shouldn't be any concern there.
If you're picking up any of the points above, please reply below so others are aware. If you need assistance with contributing or have any queries on implementation detail then please reach out to me also.

Whilst firebase_database isn't currently a package officially in our scope (@invertase) right now
@Salakar
Why? Isn't RTBD a first-class Firebase citizen, on same level as Firestore, Storage etc.
First it got suddenly removed from Roadmap, and now this, I'm a bit confused.

Thanks for the contribution @awazgyawali but we're closing this PR in favour of: https://github.com/FirebaseExtended/flutterfire/pull/6952


Add some chat notice dumb components

:eyeglasses: @keybase/react-hackers

The commits d673606df51e...f253b8ec694a introduce visual changes on linux. :mag_right: 4 new, 1 changed

Added: Unfollow_Notice-Normal

Added: Profile_Reset_Notice-Normal

Added: Old_Profile_Reset_Notice-Normal

Added: Follow_Notice-Normal

Changed: Chat_Input-Emoji_Open (before) (after)


Create notification for post author when derivative is created

As a post author, so that I can know when someone on Workshop.codes creates a derivative of my work, I want to receive a notification when a derivative of my post is created.

Closed by #79


Version 3.13.0 contains unreleased express v4.18.0

Describe the bug
The recent release of verdaccio version 3.13.0 contains an update to core dependencies that updates express to an unreleased version: 4.18.0 -> https://github.com/verdaccio/verdaccio/commit/17271ed#diff-8ee2343978836a779dc9f8d6b794c3b2R4131
This breaks any build to run verdaccio with the following error:
error Couldn't find any versions for "express" that matches "4.18.0"

To Reproduce

Add "verdaccio": "3.13.0" to project package.json
Run yarn install --no-lockfile
See error

Expected behavior
Verdaccio installs successfully.
Environment information
Yarn: 1.17.3
Package.json:
{
  "private": true,
  "devDependencies": {
    "verdaccio": "^3.2.0",
    "verdaccio-memory": "^1.0.3"
  }
}

Verdaccio: 3.13.0

My bad .... I will roll out a new one. Sorry guys.

Unfortunately @dependabot bugged us 😞😭 https://github.com/verdaccio/monorepo/commit/01f61e69f3205f269f050dd828f15c4a5a4dac13
This time is not our fault, we will take more seriously review those PR

Builds are running ... https://github.com/verdaccio/verdaccio/commit/0c41c63b98f55bbc8845ddca203de3d429c1dd48
Docker will take couple of hours
The npm will be published soon by the CI

Thanks for the quick response @juanpicado :clap:

@HipsterBrown verdaccio 3.13.1 is available at npmjs and Docker Hub
Thanks a lot for report :smiley:


Run 7b model error,"./gemma --tokenizer tokenizer.spm --model 7b-it --compressed_weights 7b-it.sbs" ,error message: "Failed to read cache gating_ein_0 (error 294)"

Failed to read cache gating_ein_0 (error 294)                      │
Abort at /home/.../models/gemma.cpp/./gemma.cc:117: Failed│
to open model file  - does it exist?                              │

Hi, please see #5, does that help?

Yes it does, hanks ! That's indeed the cmake option to solve this error:
cmake -DWEIGHT_TYPE=hwy::bfloat16_t ..

k

Yes it does, hanks ! That's indeed the cmake option to solve this error:
cmake -DWEIGHT_TYPE=hwy::bfloat16_t ..

yes, compile with this cmake opition wihtout this error.


Update the indexer docs for token data v2.

Description
Checklist

Do all Lints pass?

[ ] Have you ran pnpm spellcheck?
[ ] Have you ran pnpm fmt?
[ ] Have you ran pnpm lint?

#630  👈
main

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @larry-aptos and the rest of your teammates on  Graphite


(Browser runtime) ReferenceError: Buffer is not defined

Describe the bug
During browser runtime this JavaScript error occurs: ReferenceError: Buffer is not defined
To Reproduce

Import and use Crawler.isCrawler(...).
Build with webpack.
Run in latest Chrome.
Note that a JavaScript error occurs:

ReferenceError: Buffer is not defined
    at e.exports.isCrawler (891.3bf818.js:1:1061)

Expected behavior
No runtime errors.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):

OS: Windows 10
Browser [e.g. chrome, safari]: Chrome
Version [e.g. 22]: 108.0.5359.94

Thanks for reporting, I will check it out asap

This happens to me when I'm trying to run the crawler at runtime inside my Angular application. This app seems to be made for nodejs only environments (or at least Buffer() isn't something that seems to be available in the context of my angular app)
Since this lib is not written using typescript, so it's hard to check where things go wrong.

Hmm, maybe we need to use something like this https://github.com/feross/buffer

It has been long time I have not checked it un the browser, but the initial example was working fine for me. Browser example

But I would suggest to use what @Startouf shared about the buffer library

@JefferyHus: The browser example directly loads the minified script. But I want to import in JavaScript as an ES module.

That would then call for some buffer polyfill, the library mentioned above will do the job.

@strarsis any updates on this one?

Well, partially. I had issues with getting the buffer polyfill to work and also keeping the overall size low.

Let me know you need more help, I will be forced to close this issue within a week.


Rule Proposal: JSX Fragment shorthand

Hey there, apologies if this was brought up in the past but I'd like to propose a new rule for the ReactFragment feature in React 16. Specifically, the rule would allow you to select between either the shorthand version <> or the <React.Fragment> version.
Additionally, people can also do const Fragment = React.Fragment so allowing them to use a custom tag for fragments as well (probably would just get built-in as prevent both <> and <React.Fragment>.

This also depends on Babel 7, right?

@alexzherdev I believe you're right, I've recently updated to Babel 7 and I remember it coming up in the patch notes.

So if we have a setting for the name of the fragment tag (i.e. Fragment vs React.Fragment), then this rule could potentially even be autofixable? Otherwise it wouldn't be safe to fix <Fragment> to <>; and in the reverse direction we wouldn't know whether to fix <> to be <React.Fragment> or <Fragment>.

@alexzherdev yes, I'd expect that just like we have a pragma for React and createElement, we'd need one for Fragment.
Autofixing to <> is thus safe; i think we'd just always autofix to React.Fragment since React is sure to be in scope.

Hmm, ok. I’m still trying to understand. I was thinking of the pragma as a way for the user to customize their preferred usage of
<React.Fragment>

vs
import { Fragment } from 'react';
<Fragment>

Setting it to Fragment would mean that it’s safe to assume <Fragment> to refer to React Fragment, not some user-defined component.
If it’s always equal to just Fragment, how would we handle the second form in the “always” case? Or would we just ignore it?

Of course - that was a simplified example, I fixed it. My point is that there’s at least two ways you could refer to <React.Fragment>.

Oh sure - i don’t think we have to account for that in the first iteration, tho.

Thanks for this. Now how do I disabled it?

@animanoir the same way you disable any rule; with eslint config, or an override comment.

just in case someones search here :
    "react/jsx-fragments": ["off"]


correct use of context

I'm trying to use the user context, but I don't understand the exact working of this one. I want to get the UID of a user with the context but I don't know if it is possible.

Hey @byHippo
The user context stores the current authenticated user object from Firebase with Email authentication.
The JSON object looks like the following:
{
    "displayName": null,
    "email"<EMAIL_ADDRESS>    "emailVerified": false,
    "isAnonymous": false,
    "metadata": [Object],
    "phoneNumber": null,
    "photoURL": null,
    "providerData": [Array],
    "providerId": "firebase",
    "uid": "Bcb7dubfsEPkHfTHmINSvuJ50Hy2"
  }

Using the React hook useContext you can access the value of the user object and then any of its properties. For example, to access UID, you'll have to do something like:
// import useContext from React
import React, {useContext} from 'react';

// in a function component
const { user } = useContext(AuthenticatedUserContext);

// then you can use it like, if the user is authenticated
useEffect(() => {
  if(user !== null){
    console.log(user.uid);
  }
}, []);

Hey @byHippo
The user context stores the current authenticated user object from Firebase with Email authentication.
The JSON object looks like the following:
{
    "displayName": null,
    "email"<EMAIL_ADDRESS>    "emailVerified": false,
    "isAnonymous": false,
    "metadata": [Object],
    "phoneNumber": null,
    "photoURL": null,
    "providerData": [Array],
    "providerId": "firebase",
    "uid": "Bcb7dubfsEPkHfTHmINSvuJ50Hy2"
  }

Using the React hook useContext you can access the value of the user object and then any of its properties. For example, to access UID, you'll have to do something like:
// import useContext from React
import React, {useContext} from 'react';

// in a function component
const { user } = useContext(AuthenticatedUserContext);

// then you can use it like, if the user is authenticated
useEffect(() => {
  if(user !== null){
    console.log(user.uid);
  }
}, []);

Thanks, that works

Thanks, that works

Great. I am closing this issue now.

Great. I am closing this issue now.


Define google Ops suite notification channels for dispatching alerts

Noting here that we already have a notification channel defined for sending alerts to slack (see https://console.cloud.google.com/monitoring/alerting/notifications?project=exac-gnomad) . I've updated our slow API queries alarm to use this instead of emailing the slack channel, since it provide a little bit better experience (in my opinion) in the messages that show up in slack. /cc @mattsolo1
We cannot currently manage push notifications to the google cloud mobile app with Terraform, since google doesn't expose their app as a channel target in the google cloud API. If we at some point want to have alert escalation policies that notify more proactively than a slack message, we will need to set up policies for either SMS alarms, or something like pagerduty. But I think for the time being the slack alarms are sufficient.


Fix get_tree_diff

Description
get_tree_diff can now handle

sep that are different from default (as mentioned in https://github.com/kayjan/bigtree/issues/306)
sep that contain forbidden symbols, there will be a fallback sep
sep that is different for tree and other_tree, this will throw error now (might not be backwards compatible)

Testing
Add test cases for all the above
Additional notes

Checklist
I have read through the contributing guidelines and ensured that

[x] I have added a descriptive title for this pull request.
[x] I have followed the convention and standards, and my code is checked for style and correctness.
[x] I have added test cases, and unit tests pass with 100% code coverage.
[x] I have updated the documentation and code docstrings.

Checklist (for reviewer)

[x] I have added label (breaking / enhancement / bug / documentation) to this pull request, if applicable.
[x] I will ensure this change is captured in the CHANGELOG.md file.

https://github.com/kayjan/bigtree/issues/306


Rename Val.__raw__ to Val._raw

Stylistically we shouldn't use double under for non-builtin fields.

(It's not just style, right? The way dunder fields are treated in Python is roughly equivalent to how defining a function called is\w in C is undefined behavior.)

(It's not just style, right? The way dunder fields are treated in Python is roughly equivalent to how defining a function called is\w in C is undefined behavior.)

Perhaps! Its been about a decade since I seriously wrote any python, other than for little one-off scripts.

In theory, CPython can add new ones at any time and so break any user code that used these for its own purposes. In practice there seems to be an unspoken agreement that libraries are allowed to grab names from that namespace in exceptional cases, but I'd still just treat them all as potential future UB.

I see there are a few other similar things, so I will fix those in another commit here.

Ah yeah I think this is me misunderstanding things, and at least the doc generators used here recognizes "leading underscore is private" which is the intention for all these fields anyway, so sounds good. Thanks @fitzgen!


[>5/n] [FlexiRaft] Implementation of vote counting optimization and last known leader

[8/n][FlexiRaft] Adding some APIs to RaftConsensus to enable e2e targeted Merlin tests
API options for e2e merlin tests
[7/n][FlexiRaft] Leader election quorum optimization  [iRitwik]
Implements the optimization based on vote history.
[6/n][FlexiRaft] Adding previous vote information to RequestVote RPC response  [iRitwik]
Added vote history to RPC response.
[5/n][FlexiRaft] Add last_known_leader information to consensus metadata  [iRitwik]
Added last known leader information to consensus metadata.

All commits either checked in or re-posted.


PDF.js not working on IE10

The PDF's text is broken on IE10.
I have used a meta tag - <meta http-equiv="X-UA-Compatible" content="IE=edge" />.
Those are fine on Chrome, Firefox, and Safari.
http://cosmopolitan.joins.com/e-Magazine/Campus/Web/viewer.html

Closing since IE10 is no longer supported since PDF.js 2.0.


Update branch protection

If there are branch protection settings for current_name, change them to name

Here is a script that records fixtures and logs them to stdout
const TOKEN = process.env.TOKEN
const octokit = require('@octokit/rest')
  .plugin(require('.'))()

const fixtures = []
octokit.hook.after('request', (response, options) => {
  fixtures.push({
    request: options,
    response
  })
})

octokit.authenticate({
  type: 'token',
  token: TOKEN
})

octokit.renameBranch({
  owner: 'gr2m',
  repo: 'rename-branch-test',
  current_name: 'master',
  name: 'latest'
})

  .then(() => {
    console.log(JSON.stringify(fixtures, null, 2))
  })

Looks like the pattern can be updated using the GraphQL API: https://developer.github.com/v4/mutation/updatebranchprotectionrule/

Find the branch protection IDs that match the current branch
query {
  repository(owner:"<owner>",name:"<repo>") {
    branchProtectionRules(first:100) {
      nodes {
        id
        pattern
      }
    }
  }
}

This is the mutation query
mutation {
  updateBranchProtectionRule (input:{branchProtectionRuleId:"<node id>",pattern:"<new branch name>"}) {
    branchProtectionRule {
      id,
      pattern
    }
  }
}

:tada: This issue has been resolved in version 1.1.0 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Issue 2 retire rolling parameter in api decorator

In this PR we:

introduce the optional "prior" parameter for POST endpoints (we already had it for GET endpoints)
deprecate the use of ISO 8601 repeating time intervals to denote rolling horizons
switch to denoting rolling horizons with regular ISO 8601 durations (a breaking API change)

I plan to update all of the API endpoints for POSTing data (meter data, prognoses, prices and weather data), but first I want to get the hardest one right: postPriceData, which forces me to take into account knowledge horizons properly. You probably have some good API coding tips for me at this point already, concerning the use of marshmallow perhaps, before I move on to the other endpoints.

I'd like to keep the name for the prior field for now. Terminology is a big issue in itself. We can revisit the name later if needed, but I would like to keep terminology consistent across FlexMeasures (also with respect to other fields) and that deserves a discussion of its own.

Keeping terminology consistent would require discussing a term well before merging the PR that introduces it to main, no?

The "prior" field is already used on main denoting the equivalent concept for GET requests, so for me, keeping terminology consistent is naming this field for POST requests the same. I cannot follow up on your suggestion for renaming the prior field for POST requests without a discussion of renaming the equivalent field for GET requests, too, as well as the closely related "horizon" field used for both GET and POST requests.

I overlooked that it is on main already. Go on and merge. Let's briefly discuss my naming idea in person / on the phone.


Live configuration

[ ] Add struct tag to watch config variables
[ ] Get config from consul KV store
[ ] Add docker-compose.yml with Gonvey & consul
[ ] Add script to populate consul with config

Moved to potential future improvements, see #15 for more info on why.


Support empty SQS queue

It blows up when the SQS queue is empty when started up. This fixes the
issue.

related to #46

:+1: thanks!


Map request: Straight road with crosswalk and stoplines

Map request

reference:

Implementation suggestion
we need to place the stop line 7m in front of the crosswalk in GeoJSON and then split the lane in OpenDRIVE at the leading edge of the stop line.

Among the various map_request tickets, this one is highest priority.


NCGenerics: remove the reverse-condfail workaround

This should no longer be needed, after having staged the first set of changes in, as it was a temporary workaround.
resolves rdar://131560183

@swift-ci test

@swift-ci test


set up the project

Highlights

[x] Remove some files that came with react installation
[x] Setup the project
[x] Create components
[x] Add react router and configure routing
[x] Add linters
[x] Ensure all linters pass

Hi @kennedyowusu,
While you made a great effort in this project, I cannot proceed to review your code.
Invalid Code Review Request
You have submitted a project that does not have a descriptive readme. Kindly update your readme using the template. Kindly ensure you remove the logo and that the table of contents link are present and work properly
Your Code Review Request will be marked as invalid in your Dashboard, so please submit a new one once you are ready 🙏
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.

Invalid Code Review Request does not count into the code reviews limit.


Add FAQ section to docs

EDIT: see full extend of the PR below https://github.com/EnzymeAD/Enzyme.jl/pull/1343#issuecomment-2003307409
Fix #1329 by adding a note to the Duplicated docstring

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.54%. Comparing base (2f6d564) to head (e4ec856).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1343       +/-   ##
===========================================
+ Coverage   75.19%   93.54%   +18.34%
===========================================
  Files          35        7       -28
  Lines       10669      248    -10421
===========================================
- Hits         8023      232     -7791
+ Misses       2646       16     -2630

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

I used the opportunity to restructure a bit, as mentioned in #1344
The Duplicated explanation is now part of a broader "FAQ" page, which also contains the former end of the home page and the pullback stuff.
I switched the order of the tutorials to put the basic one first, and renamed it accordingly.

Hopefully the build works, it failed locally due to dependency shenanigans (similar to #1189)

guillaume Enzyme.jl ±|gd/duplicated_same ✗|→ julia --project=docs -e '
    using Pkg
    Pkg.develop(path="lib/EnzymeCore")
    Pkg.develop(path="lib/EnzymeTestUtils")
    Pkg.develop(PackageSpec(path=pwd()))
    Pkg.instantiate()
    include("docs/make.jl")
'
   Resolving package versions...
    Updating `~/Work/GitHub/Julia/Enzyme.jl/docs/Project.toml`
⌅ [e30172f5] + Documenter v0.27.25
  [f151be2c] + EnzymeCore v0.7.0 `../lib/EnzymeCore`
  [98b081ad] + Literate v2.16.1
    Updating `~/Work/GitHub/Julia/Enzyme.jl/docs/Manifest.toml`
  [a4c015fc] + ANSIColoredPrinters v0.0.1
  [ffbed154] + DocStringExtensions v0.9.3
⌅ [e30172f5] + Documenter v0.27.25
  [f151be2c] + EnzymeCore v0.7.0 `../lib/EnzymeCore`
  [b5f81e59] + IOCapture v0.2.4
  [682c06a0] + JSON v0.21.4
  [98b081ad] + Literate v2.16.1
  [69de0a69] + Parsers v2.8.1
  [aea7be01] + PrecompileTools v1.2.1
  [21216c6a] + Preferences v1.4.3
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [b77e0a4c] + InteractiveUtils
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [ca575930] + NetworkOptions v1.2.0
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [fa267f1f] + TOML v1.0.3
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [e37daf67] + LibGit2_jll v1.6.4+0
  [29816b5a] + LibSSH2_jll v1.11.0+1
  [c8ffd9c3] + MbedTLS_jll v2.28.2+1
        Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Enzyme [7da242da]:
 Enzyme [7da242da] log:
 ├─possible versions are: 0.1.0-0.11.20 or uninstalled
 ├─restricted to versions 0.11-0.12 by EnzymeTestUtils [12d8515a], leaving only versions: 0.11.0-0.11.20
 │ └─EnzymeTestUtils [12d8515a] log:
 │   ├─possible versions are: 0.1.5 or uninstalled
 │   └─EnzymeTestUtils [12d8515a] is fixed to version 0.1.5
 └─restricted by compatibility requirements with EnzymeCore [f151be2c] to versions: 0.1.0-0.10.9 or uninstalled — no versions left
   └─EnzymeCore [f151be2c] log:
     ├─possible versions are: 0.7.0 or uninstalled
     └─EnzymeCore [f151be2c] is fixed to version 0.7.0
Stacktrace:
  [1] propagate_constraints!(graph::Pkg.Resolve.Graph, sources::Set{Int64}; log_events::Bool)
    @ Pkg.Resolve ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/Resolve/graphtype.jl:1072
  [2] propagate_constraints! (repeats 2 times)
    @ ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/Resolve/graphtype.jl:1008 [inlined]
  [3] simplify_graph!(graph::Pkg.Resolve.Graph, sources::Set{Int64}; clean_graph::Bool)
    @ Pkg.Resolve ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/Resolve/graphtype.jl:1533
  [4] simplify_graph! (repeats 2 times)
    @ ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/Resolve/graphtype.jl:1532 [inlined]
  [5] resolve_versions!(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, julia_version::VersionNumber, installed_only::Bool)
    @ Pkg.Operations ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:407
  [6] targeted_resolve(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
    @ Pkg.Operations ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1360
  [7] tiered_resolve(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, julia_version::VersionNumber, try_all_installed::Bool)
    @ Pkg.Operations ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1349
  [8] _resolve(io::Base.TTY, env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
    @ Pkg.Operations ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1370
  [9] develop(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
    @ Pkg.Operations ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1410
 [10] develop
    @ ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1402 [inlined]
 [11] develop(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; shared::Bool, preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::@Kwargs{io::Base.TTY})
    @ Pkg.API ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/API.jl:225
 [12] develop(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{})
    @ Pkg.API ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/API.jl:159
 [13] develop(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/API.jl:148
 [14] develop
    @ ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/API.jl:146 [inlined]
 [15] develop(; name::Nothing, uuid::Nothing, version::Nothing, url::Nothing, rev::Nothing, path::String, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::@Kwargs{})
    @ Pkg.API ~/.julia/juliaup/julia-1.10.2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/API.jl:176
 [16] top-level scope
    @ none:4

Documentation passes, the rest is not on me

I updated the link to the section of the docs

I think a couple more are missing like https://github.com/EnzymeAD/Enzyme.jl/blob/778deecdc9c13f07c3415f0b89de19a33d8372e1/src/Enzyme.jl#L267
and
https://github.com/EnzymeAD/Enzyme.jl/blob/778deecdc9c13f07c3415f0b89de19a33d8372e1/src/compiler.jl#L516

going to bed now, it's 11 in Switzerland ;) will pick it up tomorrow with your remarks! thanks for helping me out on this

going to bed now, it's 11 in Switzerland ;) will pick it up tomorrow with your remarks! thanks for helping me out on this

And thank you so much for working on this! Hopefully together we can make this easier for folks to use/understand!

Perhaps in another follow up PR, but @gdalle can I distract you further into helping digest https://discourse.julialang.org/t/how-do-you-speed-up-the-linear-sparse-solver-in-zygote/111801/36?u=wsmoses into additional and accessible docs?

I put the advanced details @wsmoses suggested to add in a separate issue #1355
Since this PR is first a foremost moving stuff around, I suggest we merge it and come back to the content at a later time. What do you think?

Would it not be possible to check weather on or two of the arrays are views and then not raise the error? I'm fairly new to Julia, but I assume using a view is oftentimes a best practice. Especially when using an iterative solver, where the entire history of forward results of x need to be stored.


Added ability to authentication proxies

Resolved a problem with authentication proxies.
I used websocket connection without ready-made functions because there has delay. For this to work, you need to send a request without delay and queues.
Maybe it's seeming like hard code but it works. If you have any ideas for better realization please let me know)

Please add a test to show how this works; ideally, the test would spin up a local http proxy with authentication, so that we would test the real feature without having to use a proxy somewhere on the internet.

The reviewing issues are not addressed. And I think it's not a good idea to implement it in chromedp. I have created a PR (https://github.com/chromedp/examples/pull/30) to show how to authenticate a proxy server. I will close this PR once that PR is merged.
@webjohny Please let me know if you think differently.


Feature/ioda v3

Description
Upgrade to the use IODA version 3 variable name conventions.
Other side changes:

Add the BuildJediByLinkingTask. If this task fails because the code needs to actually be built then the BuildJedi task is triggered. But if BuildJediByLinkingTask succeeds then BuildJedi, which requires compute resources, never runs.
Removes the need to know where the build is coming from in the modules file. I.e. no longer depend on modules in the nightly build. module use on the nightly modulefiles path was taking a long time for some reason so this also speeds up the workflows quite a bit.

Dependencies
N/A
Impact
N/A

Hi @jardizzo. That's right. We had this line in the modules file:
module use -a /discover/nobackup/gmao_ci/swell/nightly/modulefiles/
Executing this was very slow for me and for the swell tasks that were running in slurm I saw it take up to 20mins. I'm not sure what the problem is in that directory structure is but in any case it's not quite the right thing to do. In the case that the user selects to create their own JEDI build they would want to use IODA's Python API from their own build. So I took out of your modules file the PYTHONPATH bits and put it into the modules files but pointing to the experiment build. In the case that the user chooses to link to the nightly then they will have the same thing, but in the case that they choose to build in the experiment it will also point to the right thing.

BuildJedibylinking is a great addition.

We should do the same thing for the static background model in the 3DVar to avoid waiting in the queue just to link some files. There it is of particular importance too because that task may require a larger number of nodes for high resolution cases.


Graph Editor: Add floating popup to pins when hovered

To improve usability and remove uncertainty regarding UiNode pins without needed to always look at the node property, a floating window or static info pane indicating the Type of the input/output, and either its value (if set, or the default value if not) or "Connected to out" if it's connected when hovering over node input or node ouput would be extremely useful.

Hi, I’m interested in doing the Graph Editor: Add floating popup to pins when hovered task for DevDays next week as a good first issue!


Support Python 3.10 and 3.11, Deprecate Python 2.7 and 3.5

Description of Changes

Support Python 3.10 and 3.11
Deprecate Python 2.7 and 3.5
Update tooling

Test Plan

Local build for Linux works
Mac OS is untested

Doesn't seem like embartrucks is maintaining the repo anymore. I really liked this little package...


scale_fixes Notes

Notes
Bowed Drone

Does not seem to output any sound

Drip Water

Reverb Mix does not seem to work

Four Osc (I think it's only 3 oscillators if I'm not mistaken)

update the pdf file to match controls

Fix oscillator knobs (Start: Master, Density: Osc 1, Size: Osc 2, Overlap: Osc 3)
add slew (blend) knob and VCA (window) knob that aren't labeled
Speed and Pitch don't do anything, not sure if they are suppose to

Plucked Patterns

Attack/Release do not work

Hi, is there anyone working on these issues?


DropInfo.InsertPosition Evaluation Issue

Hello!
I'm not sure if this is a bug of your library.
I have a TreeView with several hierarchical items. If I drop a item after the last item on the same level it should insert the item at the end of the list of subitems on this level.
However somehow the DropInfo.InsertPosition is evaluated wrong.
As you can see on the following screenshot the value of dropInfo.InsertPosition is AfterTargetItem as it should be. However it is still evaluated as BeforeTargetItem and the first line after the if is executed.

I also tried Enum.HasFlag with the same result.
Is there something I'm missing?

@pschimmel With which version does this happen?

I'm using version <IP_ADDRESS> (.NET 4)

@pschimmel so can you test the latest source? also avaialble via pre nuget.

I updated to version 1.0.0 Alpha 011 but still no luck.
I was able to reproduce the issue in your DefaultsExample, however it seems that I cannot upload a zip file as an attachment to a post.
The changes I made are rather simple, maybe you could reproduce them in your environment (sorry for the sloppy programming style):
I changed the XAML of the MainWindow under the "Bound TreeViews" tab as follows:

Then I changed the Data class:
void IDropTarget.DragOver(IDropInfo dropInfo)
{
  DragDrop.DefaultDropHandler.DragOver(dropInfo);
  if ((dropInfo.Data is CustomDataModel) || dropInfo.TargetGroup == null) {
    //dropInfo.Effects = System.Windows.DragDropEffects.None;
  }
}

void IDropTarget.Drop(IDropInfo dropInfo)
{
  DragDrop.DefaultDropHandler.Drop(dropInfo);
  if (dropInfo.InsertPosition.HasFlag(RelativeInsertPosition.BeforeTargetItem))
    MessageBox.Show("B-4"); // This is shown if example fails
  var data = DefaultDropHandler.ExtractData(dropInfo.Data).OfType<GroupedItem>().ToList();
  foreach (var groupedItem in data) {
    groupedItem.Group = dropInfo.TargetGroup.Name.ToString();
  }
  if (dropInfo.TargetCollection is ICollectionView) {
    ((ICollectionView)dropInfo.TargetCollection).Refresh();
  }
}

If you drag Item 0 and drop it after Item 9 a MessageBox is shown although it should not have been.

Thats because RelativeInsertPosition should be changed. Check issue https://github.com/punker76/gong-wpf-dragdrop/issues/60
You can test it:
        private void Test(RelativeInsertPosition value, RelativeInsertPosition has, bool expected)
        {
            System.Diagnostics.Debug.WriteLine("Value = {0}; Expected = {1}", value.HasFlag(has), expected);
        }

        private void TestRelativeInsertPosition()
        {
            Test(RelativeInsertPosition.BeforeTargetItem, RelativeInsertPosition.BeforeTargetItem, true);
            Test(RelativeInsertPosition.AfterTargetItem, RelativeInsertPosition.BeforeTargetItem, false);
            Test(RelativeInsertPosition.TargetItemCenter, RelativeInsertPosition.BeforeTargetItem, false);

            Test(RelativeInsertPosition.BeforeTargetItem | RelativeInsertPosition.AfterTargetItem, RelativeInsertPosition.BeforeTargetItem, true);
            Test(RelativeInsertPosition.BeforeTargetItem | RelativeInsertPosition.TargetItemCenter, RelativeInsertPosition.BeforeTargetItem, true);
            Test(RelativeInsertPosition.AfterTargetItem | RelativeInsertPosition.TargetItemCenter, RelativeInsertPosition.BeforeTargetItem, false);

            Test(RelativeInsertPosition.BeforeTargetItem | RelativeInsertPosition.AfterTargetItem | RelativeInsertPosition.TargetItemCenter, RelativeInsertPosition.BeforeTargetItem, true);
        }

And output:
Value = True; Expected = True
Value = True; Expected = False
Value = True; Expected = False
Value = True; Expected = True
Value = True; Expected = True
Value = True; Expected = False
Value = True; Expected = True

@pschimmel @kosorin Should be fixed with 3b0995cfce9a38c70f8674773204dcb173fd20b4


Use bpf_link for perf_attach programs (Kprobe/Uprobe/Tracepoint etc...)

This adds support for using bpf_link to perf_attach programs.
In addition, it also makes the feature detection a lazy-static, which while not strictly necessary should allow applications to do feature detection only once when using Aya vs. every time a Bpf object is created.
This also allows for features to be used in other parts of the codebase that might require feature discovery to have happened already - I think I ran into this in the USDT probe PR which is why I implemented this in the first place!

/cc @astoycos if you want to pull this for testing


build error according to README

Dears,
I try the build ( refer https://github.com/dropoutlabs/tf-trusted#build-and-run-tf-trusted ) and failed with following error message.
Could you help with this ?
$ docker run -it --name tf-trusted --rm
-v droplab-bazel-cache:/root/.cache/bazel
-v pwd:/opt/my-project
-w /opt/my-project
-p 50051:50051/tcp -p 50051:50051/udp
gcr.io/asylo-framework/asylo
bazel run --config=enc-sim //tf_trusted
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 3e917c6f-8fa6-4d54-aaac-78acb786e384
ERROR: /root/.cache/bazel/_bazel_root/b6bc0828d5b43c7085b650e0698bf388/external/com_google_protobuf/BUILD:599:1: Traceback (most recent call last):
File "/root/.cache/bazel/_bazel_root/b6bc0828d5b43c7085b650e0698bf388/external/com_google_protobuf/BUILD", line 599
internal_gen_well_known_protos_java(srcs = WELL_KNOWN_PROTOS)
File "/root/.cache/bazel/_bazel_root/b6bc0828d5b43c7085b650e0698bf388/external/com_google_protobuf/protobuf.bzl", line 266, in internal_gen_well_known_protos_java
Label(("%s//protobuf_java" % REPOSITOR...))
File "/root/.cache/bazel/_bazel_root/b6bc0828d5b43c7085b650e0698bf388/external/com_google_protobuf/protobuf.bzl", line 266, in Label
REPOSITORY_NAME
builtin variable 'REPOSITORY_NAME' is referenced before assignment.
ERROR: /root/.cache/bazel/_bazel_root/b6bc0828d5b43c7085b650e0698bf388/external/com_google_protobuf/BUILD:382:1: Target '@com_google_protobuf//:android' contains an error and its package is in error and referenced by '@com_google_protobuf//:protoc'
ERROR: /root/.cache/bazel/_bazel_root/b6bc0828d5b43c7085b650e0698bf388/external/com_google_protobuf/BUILD:382:1: Target '@com_google_protobuf//:windows' contains an error and its package is in error and referenced by '@com_google_protobuf//:protoc'
ERROR: /root/.cache/bazel/_bazel_root/b6bc0828d5b43c7085b650e0698bf388/external/com_google_protobuf/BUILD:382:1: Target '@com_google_protobuf//:windows_msvc' contains an error and its package is in error and referenced by '@com_google_protobuf//:protoc'
ERROR: /root/.cache/bazel/_bazel_root/b6bc0828d5b43c7085b650e0698bf388/external/com_github_grpc_grpc/src/proto/grpc/reflection/v1alpha/BUILD:21:1: every rule of type proto_library implicitly depends upon the target '@com_google_protobuf//:protoc', but this target could not be found because of: Target '@com_google_protobuf//:protoc' contains an error and its package is in error
ERROR: Analysis of target '//tf_trusted:tf_trusted' failed; build aborted: Analysis failed
INFO: Elapsed time: 214.936s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (44 packages loaded, 2433 targets
FAILED: Build did NOT complete successfully (44 packages loaded, 2433 targets
configured)
currently loading: @org_tensorflow//tensorflow/contrib/lite/kernels
Fetching @boringssl; fetching 8s
Fetching @jinja; fetching

Hey there @overunix,
It looks like Asylo recently released a new docker container with some breaking changes to our current setup. I think this can be fixed once tensorflow as released version 1.13.0. Until that happens and we do some upgrades here we can use the older version of the Asylo docker container.
I'll update the docs to pin to this version.
Thanks for the bug! And let me know if you have any other questions. Happy to help!

Now works, thanks for quick response @justin1121 .


Add paperboy.conf file reader

Implement the read method to read and store the course information.

Config file reader was added in commit 025b140 when paperboy.py was updated to be object-orientated.


Add composer library to vscode plugin

Purpose
Add composer library to vscode plugin

Codecov Report

Merging #15233 into master will increase coverage by 5.49%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #15233      +/-   ##
==========================================
+ Coverage      11%   16.49%   +5.49%
==========================================
  Files          38       43       +5
  Lines        1163     1285     +122
  Branches      191      212      +21
==========================================
+ Hits          128      212      +84
- Misses       1022     1060      +38
  Partials       13       13

Impacted Files
Coverage Δ

composer/packages/tracing/src/ToolBar.tsx
71.05% <0%> (ø)

composer/packages/tracing/src/TraceList.tsx
94.44% <0%> (ø)

composer/packages/tracing/src/DetailView.tsx
79.31% <0%> (ø)

composer/packages/tracing/src/TraceLogs.tsx
70.83% <0%> (ø)

composer/packages/tracing/src/index.ts
0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb11ed8...0a7cbc3. Read the comment docs.


Cross-Compiling for ARM Based Computers?

Is it possible if we can get a Cross-Compiling feature for ARM based computers?

This project outputs C code that can be compiled on any platform. Supporting specific platforms is something a person using this tool would have to do, not something this tool does itself.


Infinite loop

When FCM-ing a notification, the code would go into infinite loop.
This https://github.com/rafaelsetragni/awesome_notifications/issues/299 fixed it. ie, commenting out
    // if #available(iOS 10.0, *) {
    //     UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
    // }

Questions to developer

I also commented out

// application.registerForRemoteNotifications()

Is this correct?

Can you add this much necessary change of code on the pub.dev main page? It seems like a very important thing to do.

The below code is my AppDelegate.swift code. Is it correct?

import UIKit
import Flutter
import Firebase
import FirebaseMessaging

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {

    //https://stackoverflow.com/questions/64014893/my-flutter-firebase-app-is-showing-no-app-has-been-configured-yet
    FirebaseApp.configure()
    GeneratedPluginRegistrant.register(with: self)

      //https://stackoverflow.com/questions/58246620/apns-device-token-not-set-before-retrieving-fcm-token-for-sender-id-react-nati
    // if #available(iOS 10.0, *) {
    //     UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
    // }
    // application.registerForRemoteNotifications()

    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }

    //https://stackoverflow.com/questions/60350461/flutter-firebase-messaging-not-working-on-ios-when-app-running-in-background-or
    override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {

   Messaging.messaging().apnsToken = deviceToken
   super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
 }
}

Thank you so much on your amazing work!

Hi! Sorry for taking so long to respond to your issue on GitHub. I was focused on releasing the new 0.7.0 version of awesome_notifications and awesome_notifications_fcm and i didn't had time enough to do both. But now I can answer all your questions.
So now i'm asking you to recreate this topic using the new issue template. There's a lot of missing informations that i need to understand your problem, and all the instructions are already in the new issue template. Also, remember to check beforehand if your issue was posted by another user.
So I will automatically close all previous issues so far.
Sorry for the inconvenience and i will be waiting for your new issue request.
Thank you so much for your support!


[FEATURE] Ability to use HwAddr to lookup NetworkInterface Name in harvester-installer.

Is your feature request related to a problem? Please describe.

Currently harvester-installer needs a create.yaml or join.yaml which contains the name of the interface to be used for harvester-mgmt network definition. This generally works fine in private cloud environments where the hardware details are available before hand or if we are using the ISO installation method.
When using PXE installation method, coupled with use in public metal cloud providers this becomes more challenging since the network interface name generated by the OS can vary based on the type of underlying hardware.
Describe the solution you'd like

The NetworkInterface kind allows users to specify Name and HwAddr (MAC address). Empty Names are not allowed, even if HwAddr is specified. Users should be able to provide just an empty Name with a valid HwAddr and the harvester-installer should be able to lookup the HwAddr from available interfaces and populate the device name at runtime. This will make it easier to configure PXE installation as the user doesnt need to factor in predefined interface names before hand.
Describe alternatives you've considered

Additional context

Addressed by: https://github.com/harvester/harvester-installer/pull/183

To Test:

Ability to use HwAddr to lookup NetworkInterface Name in harvester-installer, mode details please refer to https://github.com/harvester/harvester-installer/pull/183#issue-1072692585

An example of the PXE config with the network part is shown below, the interface name is not required if hwAddr is provided.
  networks:
    harvester-mgmt:
      interfaces:
      - hwAddr: '0c:c4:7a:6b:84:20'
      default_route: true
      method: dhcp
      bond_options:
        mode: balance-tlb
        miimon: 100

verified this feature works as expected, document need to be updated correspondingly.
The config content for this issue:
server_url: https://<IP_ADDRESS>:8443
token: token
os:
  hostname: harvester-node-1
  ssh_authorized_keys:
    - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
  password: p@ssword
  ntp_servers:
    - 0.suse.pool.ntp.org
    - 1.suse.pool.ntp.org
install:
  mode: join
  networks:
    harvester-mgmt:
      interfaces:
      - hwAddr: '02:00:00:35:86:92'
      # - name: ens6   # The management interface name
      method: dhcp
    bond0:
      interfaces:
      - name: ens5
      method: dhcp
  device: /dev/vda       # The target disk to install
  iso_url: http://<IP_ADDRESS>/harvester/harvester-amd64.iso
#  tty: ttyS1,115200n8   # For machines without a VGA console
  tty: ttyS0

Test Information

Environment: qemu/KVM 2 nodes
Harvester Version: master-5d739671-head
ui-source Option: Auto

Verify Steps:

Install Harvester with PXE installation, set hwAddr instead of name in install.networks
Harvester should installed successfully


Fix: agentmessage streaming should show actions

Description
Moves the 'streamedAgentMessage' to the new format

Not sure there's a good way to get better type support here?

Apparently the type system can help you when using the simple form of setState:
const [message, setMessage] = useState<MessageType>(...)

setMessage({unknown_property: v}) // typescript error

but can't help you when using the "previous state form":
setMessage((previousState) => ({...previousState, unknownProperty:v})) // no Typescript error

A practical solution is to add a satisfy or the return type of the setState() callback function:

setStreamedAgentMessage((previousState): AgentMessageType => {
    return { ...previousState };              ^^^^^^^^^
  });


Ability to fetch schema

A user should have the ability to GET the /schemas endpoint and receive back all the schemas in the Postgres database

This one is important for Auth, as I need to split out some of the functions into a separate schema. Also useful for the change we're making to Extensions - enabling/disabling them all in a separate schema

Isn't this already implemented? https://supabase.github.io/pg-api/#pg-api-schemas

My favourite type of issues are already solved


Paging CSS at bottom of page is missing.

Attaching screenshots appears broken.

What I'm seeing now on plum.princeton.edu (same locally and with Hyrax master):

The "Previous" and "1" links go to the current page and have the disabled class, but are otherwise the same as the other links.  Do we want to gray them out? Actually disable them with javascript?

Either of this is fine w/ me.

Er, I assumed that this was using the bootstrap paging CSS and it just wasn't loading. Maybe I was wrong?


Dialog with array mapping

I'm trying to create a functionality for deleting an object within an array. However, when passing the object's name as a parameter to delete it, the name that is passed to my function is from the last object, rather than the specified one.

When I pass this same function with the same parameter, but outside of DialogContent, it works normally.

Me too, any solution?

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

I see that you have one state that opens all dialog so only the last one is showing up. Try using one global dialog outside this map; it should work.


no-access-state-in-setstate false negative in async class method

I'm getting a false positive from the no-access-state-in-setstate rule with this method in a class component:
async onSubmit(event) {
	event.preventDefault()
	this.setState({ submitting: true })

	const res = await fetchJSON(
		"/api/user",
		"POST",
		this.state.values, // error: "Use callback in setState when referencing the previous state."
	)

	if (!res.error) {
		return this.props.router.push("/")
	}

	this.setState({
		submissionError: res.error,
		submitting: false,
	})
}

If I rewrite that as fetchJSON(...).then(res => ...) the error goes away. (It actually goes away if I just remove the const res = part, but then I can't use the returned value.)

eslint 7.24.0
eslint-plugin-react 7.23.2

Here's my ESLint configuration:
module.exports = {
	env: {
		browser: true,
		commonjs: true,
		es2021: true,
		node: true,
	},
	extends: [
		"eslint:recommended",
		"plugin:react/recommended",
	],
	parserOptions: {
		ecmaVersion: 2021,
		sourceType: "module",
		ecmaFeatures: {
			jsx: true,
		},
	},
	plugins: [
		"react",
	],
	rules: {
		// ...
		"react/button-has-type": 2,
		"react/jsx-child-element-spacing": 2,
		"react/jsx-curly-brace-presence": [1, "never"],
		"react/jsx-curly-newline": [1, "consistent"],
		"react/jsx-curly-spacing": [1, { when: "never", allowMultline: true }],
		"react/jsx-equals-spacing": [1, "never"],
		"react/jsx-first-prop-new-line": [1, "multiline-multiprop"],
		"react/jsx-indent": [1, "tab"],
		"react/jsx-no-script-url": 2,
		"react/jsx-no-target-blank": 1,
		"react/jsx-no-useless-fragment": 1,
		"react/jsx-props-no-multi-spaces": 1,
		"react/jsx-tag-spacing": [1, { beforeClosing: "never", beforeSelfClosing: "always" }],
		"react/jsx-wrap-multilines": 1,
		"react/no-access-state-in-setstate": 2,
		"react/no-adjacent-inline-elements": 2,
		"react/no-unused-prop-types": 2,
		"react/no-unused-state": 2,
		"react/prop-types": 0,
		"react/self-closing-comp": 1,
		"react/state-in-constructor": 2,
	},
	settings: {
		react: {
			version: "detect",
		},
	},
}

I was able to reproduce the false positive with this code
class Foo extends React.Component {
  async onSubmit() {
    this.setState({submitting: true});

    const result = this.state.values;

    this.setState({
      submitting: false,
      result
    });
  }
}

Also this one
class Foo extends React.Component {
  foo() {
    this.setState({
      submitting: false,
      result: this.state.values
    });
  }
}

@Wesitos where's the false positive? While in both of those examples, nothing calls or references those class methods (which makes them dead code and thus, they should be deleted), they're still likely incorrect.

@ljharb My first approach is to reduce the code. Both code snippets give me a no-access-state-in-setstate (with version 7.24.0) . I believe these snippets are equivalent to the one of @armordecai. I was not sure if these were false positives or expected behavior. Do you consider @armordecai 's issue (or his workaround) is expected behavior?

Actually, after rereading the OP, I don't think there's a bug here at all.
The code is supposed to look something like this (i'm using new Promise here so the later awaits can be used):
async onSubmit(event) {
	event.preventDefault()
        const { values } = new Promise((resolve) => {
		this.setState({ submitting: true }, resolve);
	});

	const res = await fetchJSON(
		"/api/user",
		"POST",
		values,
	);

	if (!res.error) {
		return this.props.router.push('/');
	}

	return new Promise((resolve) => {
		this.setState({
			submissionError: res.error,
			submitting: false,
		}, () => resolve());
	});
}

Your first minimal example is a correct warning.
Your second minimal example, however, is a bug - since you're accessing this.state before the setState call happens, not after.
I'm going to close this as "working as intended", but please file that second example as a separate issue so it can be fixed.

Actually, after rereading the OP, I don't think there's a bug here at all.

@ljharb I disagree. The two examples @Wesitos posted are not false positives -- both (effectively) access this.state inside a this.setState call, which is what the no-access-state-in-setstate rule should be warning about. By contrast, the example in my OP does not pass anything derived from this.state to any setState call, so the rule should have no opinion about it.

The code is supposed to look something like this (i'm using new Promise here so the later awaits can be used):

JavaScript doesn't require that an async function returns a promise. If some people would like to add that requirement that as a matter of preference, that could be a candidate for a new ESLint rule, but it doesn't have anything to do with this rule, or even with React in general. In my case, this function is an event handler, so any value it returns, promise or otherwise, will never be used, or even seen, by anything.
As for the first part of your suggested rewrite, I guess you were concerned about my fetchJSON call potentially happening before the re-render from changing the submitting state to true was finished, but that state only controls a visual UI affordance (letting users know that clicking the button actually did something), and there's no reason for that to block or delay sending the network request. Even if the network request fully completes before the first re-render, that still doesn't matter, since in most cases the component will be unmounted anyway at that point, and even in the error case, React handles multiple setState calls in the order they were made, so the "worst case" scenario is that the first re-render doesn't actually happen, and the submitting state never actually changes, but that wouldn't be a problem at all.
And keep in mind, even if we have different opinions about the best / safest / prettiest way to write this, the code in my OP works flawlessly and is perfectly valid JavaScript, and doesn't logically violate this specific rule, as there is no state access in any setState call.

@armordecai once setState has been invoked, it is no longer safe to access this.state.
If in your specific use case, you don't care about the risk there, an eslint override is appropriate - but the guidance of the rule, and the React team itself, is that such access must be done inside the callback, or before the setState call.

@ljharb Even so, I think there's still a bug here, you may just want to solve it in the opposite direction. As mentioned in the OP, if I rewrite this:
const res = await fetchJSON(..., this.state.values)
setState({ ..., submissionError: res.error })

as this:
fetchJSON(..., this.state.values).then(res => {
   setState({ ..., submissionError: res.error })
})

then the rule passes, even though the difference is only syntactic sugar. I don't think either one should be considered a rule violation (the state values I'm accessing after the setState call aren't in any way affected by the setState call, and React doesn't temporarily remove or alter the rest of the state while an update is in progress), but if one is, then both should be.

I agree, both should be errors. setState calls can be batched, so you can’t actually guarantee that it’s not affected by the setState call.

setState calls can be batched, so you can’t actually guarantee that it’s not affected by the setState call.

Maybe I'm missing something, but none of the setState calls in my code include values, so that seems like a pretty solid guarantee that this.state.values won't be affected, whether or not the setState calls are batched?

I realize that in your specific case there's no risk. However, setState calls could be batched from anywhere in the component - not just this method - and in dynamic ways, and the limits of static analysis are such that it's simply not a safe thing to allow.
A parallel would be == - when you're comparing things that can only ever be of the same type, you can make an argument that it's "safe" to use ==. But, the linter rule (and styleguides) will tell you to always use === just in case - because it's a safer habit to get into.
The same applies here. It is a much safer habit to get into to write your code safely than to use an unsafe pattern that one-off specifics happen to make safe.

I was able to reproduce the issue with this code

and there is where i am using


Fix a typo in required magic version

@urish Thanks! I need to bump this anyways, so I'll fix it in another PR.


Docs problem

error! I'm not set!
error! I'm not set!

Thanks for pointing it out - fixed in the indev docs.