Skip to content

TF-3358 Save draft locally periodically #3598

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

dab246
Copy link
Member

@dab246 dab246 commented Mar 26, 2025

Issue

#3358

Resolved

  • Reload page & Token Expired:
Screen.Recording.2025-03-26.at.09.02.02.mov
  • Save after 15s:
Screen.Recording.2025-03-26.at.09.16.31.mov

Copy link

This PR has been deployed to https://linagora.github.io/tmail-flutter/3598.

@dab246 dab246 requested a review from tddang-linagora March 26, 2025 08:10
@@ -1,15 +1,15 @@
import 'package:core/presentation/state/failure.dart';
import 'package:core/presentation/state/success.dart';

class RemoveComposerCacheSuccess extends UIState {
class RemoveLocalEmailDraftSuccess extends UIState {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont need to have id to see what local draft was removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is updated right on the UI so we don't need it.

import 'package:tmail_ui_user/features/caching/utils/caching_constants.dart';
import 'package:tmail_ui_user/features/mailbox_dashboard/data/model/local_email_draft.dart';

class LocalEmailDraftClient extends HiveCacheClient<LocalEmailDraft> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please dont forget to upgrade hiveDBVersion

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a new box to the hive database does not require a version upgrade. A version upgrade is only required when changing the data structure of an existing box.

import 'package:core/presentation/state/failure.dart';
import 'package:core/presentation/state/success.dart';

class SaveLocalEmailDraftSuccess extends UIState {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, we should keep the id of which local email was saved

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use it for anything right now, so keeping it at this point is unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants