-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Bump dexie dep for bugfix, improve supabase example #5469
Conversation
and resolve flakey supabase ci tests Signed-off-by: Marc MacLeod <[email protected]>
Signed-off-by: Marc MacLeod <[email protected]>
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.
In summary:
- update dexie to gracefully handle a rare chromium indexdb bug that the supabase e2e test was occasionally triggering (and thus failing)
- while i was at it I updated supabase and modernized the approach to starting it etc. fingers crossed that this has the side effect of reducing CI times
package.json
Outdated
@@ -442,7 +442,7 @@ | |||
"broadcast-channel": "7.0.0", | |||
"crypto-js": "4.2.0", | |||
"custom-idle-queue": "3.0.1", | |||
"dexie": "4.0.0-alpha.4", | |||
"dexie": "4.0.1-beta.2", |
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.
This is the crux of the issue in the flakey test - see the thread in dexie/Dexie.js#543 (comment) for more information.
Before, during the supabase e2e test (only happens sometimes, hence the flake):

After, during the supabase e2e test (still only happens sometimes, but now handled gracefully by dexie):

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.
Side note - does the premium indexdb plugin also handle this chromium bug? If not, might want to check out dexie's solution :).
window.addEventListener('unhandledrejection', (e) => { | ||
console.error( | ||
`got unhandled error`, | ||
e.reason.message, | ||
JSON.stringify({ | ||
// @ts-expect-error ignore | ||
frame: e.currentTarget?.ifrm?.id, | ||
}), | ||
e | ||
); | ||
}); |
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.
It was difficult to get to the bottom of the issue, because the page was throwing unhandled exceptions and test cafe only captures logs, not exceptions. So the test was effectively silently failing, and test cafe was just going into a loop trying to get it to pass until the test finally timed out.
Now if there are any unhandled exceptions on the page, it's logged as an error and the test cafe tests will immediately stop and print out the relevant info - should make future problems much easier to debug.
Given how test cafe seems to work - might want this same sort of thing on the rest of the e2e tests, where relevant...
until [ "$n" -ge 20 ] | ||
do | ||
pg_restore -h localhost -d postgres -U postgres dump.sql && break | ||
n=$((n+1)) | ||
echo "failed to import, will try again in 5 seconds" | ||
sleep 5 | ||
done |
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.
Ah almost forgot - this loop was always running the max 20 count - it's why the import db step in CI takes ~2m every time.
@marbemac Atm the CI fails with
Yes I think we should directly use beta.6.
I will check the basic behavior to ensure current alpha state is compatible with beta.6 state.
Unlikely, the indexeddb premium has a different way of opening storages compared to dexie so it might not be relevant, but I will check. |
Signed-off-by: Marc MacLeod <[email protected]>
Signed-off-by: Marc MacLeod <[email protected]>
Hopefully all set! |
@marbemac Thank you for your work. |
close #5466
This PR contains:
Internal error opening backing store for indexedDB.open
error in testsOpen questions: