-
Notifications
You must be signed in to change notification settings - Fork 309
snackbar: show connecting snackbar depending on bool isstale #619
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
Conversation
Thanks, @satyam372! As Greg said at #598 (comment),
For this PR, let's remove all the code that's about knowing whether the device thinks it has an Internet connection, and focus for now on the original issue, #465. So in particular, let's not add or use the It might be helpful to use From a quick read of the code in this revision, it looks like it has a bug: as long as the device continues to believe it has an Internet connection, the user won't get any feedback if the server expires the event queue (causing |
thanks @chrisbobbe for you feedback ! |
No, let's not do #555 now. This PR should only focus on the original issue, #465. The snackbar can simply say "Connecting…" for now, without giving more details.
That's right. These things are not necessary to fix the original issue, #465. |
Hi @satyam372, it looks like you've updated the PR branch. Is it ready for another review? When you push updates and it's ready for another review, it's helpful if you post a comment saying so, for explicitness. That way reviewers don't have to guess. 🙂 This revision looks like probably not what you intend to be reviewed—GitHub shows me that you're proposing 27 commits, which make changes across 20 files, and many of those changes are unexplained and not related to #465. I see you've asked for help in |
Hi @chrisbobbe, Yes, I have updated the branch, but it is not ready for review. Actually, it has gotten messed up. This was likely due to using merge instead of rebase. Then, my local main got diverged, which I have mentioned in the Git Help stream. Due to not having a history of the Git commands I ran, I have made it hard for the mentors to resolve this issue. Now, I am planning to make a new copy of the project and create a new PR. However, this will lead to many branches for a single issue. But anyhow, the previous branches contain all the wrong logic, which is of no use. Due to all the mess in the branch and in my local project, I don't think there is any other option. |
@chrisbobbe , about the bug you mentioned in the previous conversation bug: as long as the device continues to believe it has an Internet connection, the user won't get any feedback if the server expires the event queue , I addressed the bug by setting isstale=true when encountering the exception (causing ZulipApiException(code: 'BAD_EVENT_QUEUE_ID'). I tested this solution by simulating a scenario where the server expires the event queue. I used 'queue_id': RawParameter('wrong' + queueId) for testing, as mentioned in the commits of PR#561. The solution worked effectively. before using 'queue_id': RawParameter('wrong' + queueId), for testing , as i use my physical device for debugging I connected my physical device to the wifi and and then explicitly blocked internent access of my wifi keeping the wifi on (at this time the data isstale because wifi has no internet connection) but no error msg was seen on the logs of android studio. Generally it shows backing of then... will try so do we need to add another exception to handle it ? |
If you want to make a new local copy of the project (with
To answer these questions effectively we'll need to read your code. It'll be a lot easier to do that after you push a revision with clear and coherent commits. So let's start there, and then we can get into questions about the logic. |
0e5957d
to
7dc50c4
Compare
6620012
to
d882f50
Compare
Chat thread where we've discussed this PR (and its previous incarnations): It's not possible to effectively review this PR as it stands, because the commits don't make clear what's being changed and why. Please take a look at our guide on making commits clear and coherent, linked above: Please also read through our guide on making a clear, reviewable PR, and then revise this PR with a self-review: I'll mark this PR as draft for now; please feel free to mark as ready for review again after you've revised it with a thorough self-review. |
4d1912d
to
be5ef53
Compare
lib/model/store.dart
Outdated
@@ -356,6 +364,7 @@ class PerAccountStore extends ChangeNotifier with StreamStore { | |||
void handleEvent(Event event) { | |||
if (event is HeartbeatEvent) { | |||
assert(debugLog("server event: heartbeat")); | |||
setIsStale(false); |
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.
making bool isstale false when we get event queue
Please do a more careful self-review before requesting review again on this PR. Reviewers are busy, and it's important to make good use of our time. It looks like what's changed in this revision consists only of some edits to the commit messages:
The commit messages are one of the areas that needs revision. But the added text largely just restates the details that are in the code changes. That's not the sort of information that makes a commit message helpful: Apart from the commit messages, the organization of the commits themselves doesn't follow what's needed for making the changes clear: There are also no tests for the logic that controls |
2843303
to
7764dd3
Compare
7764dd3
to
dc41c73
Compare
Fixes #465 |
dc41c73
to
c8b18c3
Compare
Ready for review! @gnprice , @chrisbobbe |
This still doesn't meet our guidelines. You'll need to revise it to meet our guidelines before we can review your work. |
Previously, the absence of a dedicated mechanism to display connection-related messages resulted in users experiencing ambiguity regarding Data Staleness. By leveraging the initState and didUpdateWidget methods, the connecting SnackBar is displayed post-build and upon isStale updates. Fixes zulip#465
c8b18c3
to
336dc3b
Compare
Ready for another Review. @gnprice @chrisbobbe |
Your last three revisions have all been pretty small. As I said above at #619 (comment) , this PR needs a revision based on a thorough self-review before it will meet our guidelines for a reviewable PR. I'm closing this PR, because it doesn't seem like it's going to converge to something we can merge. You're welcome to come back next year, after you've gotten some more experience writing software and working with other people, and try again contributing a PR to Zulip then. |
issue #465
This branch adds a variable bool isstale variable and a function in Class Peraccountstore which is present in Store.dart file . This variable is updated to true when an exception is caught related to BAD_EVENT_QUEUE or Networkerror . When the variable becomes true a connecting snackbar is triggered which provides feedback to the user regarding the staleness of their data.
This Branch also adds a snackbar.dart file which is responsible for showing the connecting snackbar depending on the status of bool isstale.