Skip to content

Fix Notification Flooding & Build Method Side-Effects#446

Open
sandy4242 wants to merge 2 commits into
andoriyaprashant:mainfrom
sandy4242:main
Open

Fix Notification Flooding & Build Method Side-Effects#446
sandy4242 wants to merge 2 commits into
andoriyaprashant:mainfrom
sandy4242:main

Conversation

@sandy4242

Copy link
Copy Markdown

Problem / Issue No.

  • Fix Notification Flooding & Build Method Side-Effects

Describe Problem / Root Cause

  • Briefly tell the cause of the problem and provide relevant information

Solution proposed

  • lib/services/notificationService.dart to make notification IDs deterministic.
  • lib/opso_timeline.dart to convert OpsoTimeLineScreen to a StatefulWidget and move the scheduling logic to initState.

Implement a helper method to generate deterministic positive 31-bit integer IDs from the notification's description and body. This prevents duplication when notifications are re-scheduled.
Update _scheduleNotification to use this deterministic ID instead of generating a new one via timestamp (DateTime.now().millisecondsSinceEpoch).
Simplify the permission check logic in _scheduleNotification to eliminate redundant checks and duplicate code blocks.

Convert OpsoTimeLineScreen from a StatelessWidget to a StatefulWidget.
Move the loop that schedules notifications out of the build method and into a helper method called from initState.
Ensure that the build method is pure and only returns the widget tree without triggering any side-effects.

Additional Information

  • non

@netlify

netlify Bot commented May 28, 2026

Copy link
Copy Markdown

Deploy Preview for aquamarine-kheer-83feda failed. Why did it fail? →

Name Link
🔨 Latest commit e0c8af3
🔍 Latest deploy log https://app.netlify.com/projects/aquamarine-kheer-83feda/deploys/6a17dc7f6a83e400082a933d

@github-actions

Copy link
Copy Markdown

Thank you for submitting your pull request! We'll review it as soon as possible.

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.

1 participant