Skip to content

Spam banner: apply larger interval each time it is shown#4386

Draft
chibenwa wants to merge 1 commit intolinagora:masterfrom
chibenwa:spam-banner
Draft

Spam banner: apply larger interval each time it is shown#4386
chibenwa wants to merge 1 commit intolinagora:masterfrom
chibenwa:spam-banner

Conversation

@chibenwa
Copy link
Member

@chibenwa chibenwa commented Mar 17, 2026

Problem: The spam banner was only storing a timestamp when the user explicitly dismissed it (close button or "view spam"). If the user manually marked spam emails as read instead, no timestamp was
stored, so the banner would reappear on every app resume.

Fix in get_spam_mailbox_cached_interactor.dart:

  • Changed interval from 12 → 24 hours to match the "max once per day" spec
  • Added storeLastTimeDismissedSpamReported(DateTime.now()) at the moment the banner is shown, not just when dismissed

Now the 24h cooldown starts as soon as the banner is displayed, regardless of how the user handles it.

@coderabbitai
Copy link

coderabbitai bot commented Mar 17, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4be3d653-2883-42a3-a415-4e68a436c923

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use TruffleHog to scan for secrets in your code with verification capabilities.

Add a TruffleHog config file (e.g. trufflehog-config.yml, trufflehog.yml) to your project to customize detectors and scanning behavior. The tool runs only when a config file is present.

@chibenwa
Copy link
Member Author

Cc @hoangdat

@dab246
Copy link
Member

dab246 commented Mar 19, 2026

Hi @chibenwa , I tried running your PR but it doesn't seem to be working as expected (see demo video). In my opinion, the logic for displaying this Spam banner also has many necessary conditions, so your fix isn't working. If you don't mind, we can help you fix this issue.

Screen.Recording.2026-03-19.at.13.48.23.mov

@chibenwa
Copy link
Member Author

chibenwa commented Mar 19, 2026

I tried running your PR but it doesn't seem to be working as expected (see demo video)
we can help you fix this issue.

Please ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants