-
Notifications
You must be signed in to change notification settings - Fork 19
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
PE-4994: Prompt Users to Create a Snapshot #1517
Conversation
Visit the preview URL for this PR (updated for commit e643868): https://ardrive-web--pr1517-pe-4994-1koigns7.web.app (expires Tue, 30 Jan 2024 23:00:53 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: a224ebaee2f0939e7665e7630e7d3d6cd7d0f8b0 |
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.
Self-review checkpoint.
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.
For the reviewer - Renamed the ARB key for this because I created another with the same name.
logger.d('Done fetching data - ${gqlDriveHistory.driveId}'); | ||
|
||
promptToSnapshotBloc.add( |
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.
For the reviewer - Here we pass the count to the cubit to let it consider whether to prompt to make a snapshot
if (syncState is! SyncInProgress) { | ||
final promptToSnapshotBloc = | ||
context.read<PromptToSnapshotBloc>(); | ||
promptToSnapshotBloc.add(SelectedDrive( |
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.
For the reviewer - we now add to the bloc the SelectDrive event after the sync has finished.
CountOfTxsSyncedWithGql.countForDrive( | ||
event.driveId, | ||
event.txsSyncedWithGqlCount, | ||
); |
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.
For the reviewer - This is currently counting zero, but later on we're gonna track that number to be more precise.
} | ||
} | ||
|
||
abstract class CountOfTxsSyncedWithGql { |
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.
Hey, @thiagocarvalhodev, this is the class I mentioned earlier.
- We can extend this class and/or compose it with other similar ones to track stats as you suggested.
- And we can add the persistence here.
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.
Self-review checkpoint.
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.
Self-review checkpoint.
…nstead of the caller PE-5254
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.
Self-review checkpoint.
} | ||
} | ||
|
||
class PromptToSnapshotSnapshotting extends PromptToSnapshotState { |
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.
For the reviewer - Implemented a new state in order not to prompt while snapshotting.
class PromptToSnapshotIdle extends PromptToSnapshotState { | ||
const PromptToSnapshotIdle() : super(driveId: null); | ||
} |
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.
For the reviewer - Made the Idle state not to have a driveId.
// TODO | ||
/// txsSyncedWithGqlCount: state.notSnapshottedTxsCount, |
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.
For the reviewer - TODO for the next iteration
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.
For the reviewer -
- Once the modal gets opened, it will tell the bloc we're snapshotting.
- On success it will emit Snapshotted so the count gets reset.
- Once it's closed, it will tell the bloc no drive is selected so it goes Idle.
- add event for when the modal is closed
…r-after-closing-with-x PE-5457: modal doesnt reappear after closing with x
Changes
Note - we're leaving those TODOs for a later improvement.
--- Releases ---
Android release: https://appdistribution.firebase.google.com/testerapps/1:305132849030:android:6cf0cd5ec064fad3ffce07/releases/1ijhutiqe6nno