-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Use DataSource for entity scanning (with pausing when the window loses focus) #1634
chore: Use DataSource for entity scanning (with pausing when the window loses focus) #1634
Conversation
✅ Deploy Preview for kuma-gui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
561de7d
to
962abde
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inlines:
a611e24
to
c7f14a6
Compare
I’ve looked over this again and am mostly fine with how this works. Two things I think need to be addressed as part of this PR (linking to the relevant threads) and not only in a follow up:
Could you also please rebase this PR? |
285cb2a
to
6a78b62
Compare
Signed-off-by: John Cowen <[email protected]>
Signed-off-by: John Cowen <[email protected]>
Signed-off-by: John Cowen <[email protected]>
Signed-off-by: John Cowen <[email protected]>
Signed-off-by: John Cowen <[email protected]>
Signed-off-by: John Cowen <[email protected]>
Signed-off-by: John Cowen <[email protected]>
Signed-off-by: John Cowen <[email protected]>
Signed-off-by: John Cowen <[email protected]>
Signed-off-by: John Cowen <[email protected]>
Signed-off-by: John Cowen <[email protected]>
6a78b62
to
54433cb
Compare
Signed-off-by: John Cowen <[email protected]>
Back in #1634 we changed the functionality of checking for a connected zone by additionally catching a 404 error and retrying the request, which I'd wrongly assumed how this functioned. The endpoint only ever returns a 404 if the zone is deleted (i.e. doesn't exist). It doesn't 404 if the zone exists but is not connected. Due to the change, it was possible to create a zone, without connecting it, and then in say another tab, delete the zone, and the scanner would continue to spin due to the 404s. I've removed the 404 retries, and also added further testing for making sure a 404 shows the error page when the scanner is waiting to connect, and I also updated the mocks so that they are closer to the real responses. We decided that we should check for a `zone.enabled` (#1634 (comment)) but I don't think we ever need to check for `zone.enabled` for the purposes of this PR (or #1634) when checking for whether the zone is connected. I haven't altered anything there as yet as it doesn't have any effect, but I have updated the mocks here so that we don't get `enabled: true`, only a non-existant `enabled` (i.e. defaults to `true`) or `false`, which I 'think' is more correct. I re-added some comments explaining this a little better in a couple of places, and I almost renamed and moved around functions to help the code self-comment, but I'm a little way into a longer piece of work of collecting up zone data related functions de-duping them and refactoring them, which I'd rather continue to do separately rather than in this PR. The comments here will help when I continue with that. --------- Signed-off-by: John Cowen <[email protected]>
Replaces the EntityScanner with a DataSource.
Makes all polling/retrying DataSources pause when the tab loses focus.
Whilst doing this I made a helper to let us configure the source of the DataSource easier from the sources.ts file so you can opt in to polling rather than opt out.
Closes #1582
Also addresses a part of #1474
I wanted to note that there will be some follow up work here, but I wanted to submit this PR so we could get this in rather than keep working on related things:
DataLoader
component I spoken about in the past.