-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Fix loading homeworks for teachers #655
Conversation
To view this pull requests documentation preview, visit the following URL: docs.page/sharezoneapp/sharezone-app~655 Documentation is deployed and generated using docs.page. |
Visit the preview URL for this PR (updated for commit 6f82e64): https://sharezone-test--pr655-fix-loading-homework-u5o2f9ji.web.app (expires Thu, 13 Jul 2023 10:18:21 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 4cb3ae61e1e018abfd9841fd3239f5b49ccc034b |
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.
See comment above
// deleting the user of something). This can result into hard bug and side | ||
// effects, especially because there is no error. The .update() method would |
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.
Hard bug? Do you mean hard to find?
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.
Yes, hard bugs means bugs that are hard to debug, hard to find, hard to locate, etc
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.
I have added this definition to the comment
I think this bug was on me... Sorry!! 🙈😁 |
Although in my opinion there should be:
If I have time maybe I'm gonna raise an issue on the Dart side, but no promises yet. I guess that there might be reasons why it might be hard to actually implement it as well. |
Definitely, agree. Unfortunately, I couldn't also use performance tools, like DevTools because they're not really working for web and say that I should use Chrome DevTools, however even Chrome DevTools couldn't record it properly. |
This reverts commit fc20462.
@Jonas-Sander Any ideas why the android integration test are not passing anymore because of the changes? |
No, no idea, sorry |
@nilsreichardt Should we release a new version after this is merged? |
Yes, makes sense also because of #671 |
Summary
This PR fixes:
typeOfUser
is null for a short moment #608It's required to this all in one pull request because otherwise it would introduce a new bug.
What was the issue?
I started to debug on this problem because of #654. I found out it was because
TypeOfUser.student
was used as a backup when it's null (see #573). However, just reverting it toTypeOfUser.unknown
was not option because this would introduce #497 again.Therefore, I wondered, why
typeOfUser
can be null. The reason for this was the last time online reporter. Because.set()
has been used for Firestore, Firestore instantly was setting it null (I thinknull
is used forFirestore.currentTimestamp()
when the client is offline or the server hasn't responded yet). Using.update()
fixed the issue that the user document only containedlastOnline
.But using
update()
in the last online reporter always caused #497. Even usingTypeOfUser.student
orTypeOfUser.unknown
couldn't be as a workaround. After hours of debugging I found that when signing our the following line was causing the issue:sharezone-app/app/lib/util/api/homework_api.dart
Line 107 in 47e4ccb
The issue is that we listened to
_homeworkSubjectStream
and when an error occurred, we the.addError
method of_homeworkSubjectStream
used. This ended up into an infinity loop which resulted in the freeze (#497),This was by far one of my hardest bugs... I needed ~5,5h to find the solution and it was extremely hard to debug.
Fixes #608
Fixes #654
Fixes #497