Skip to content

Prepare AppContainer for visibility and connectivity changes to be used for Sync#2108

Open
tomivm wants to merge 9 commits intorevert-2113-revert-2097-sync-boards-actionfrom
resume-events
Open

Prepare AppContainer for visibility and connectivity changes to be used for Sync#2108
tomivm wants to merge 9 commits intorevert-2113-revert-2097-sync-boards-actionfrom
resume-events

Conversation

@tomivm
Copy link
Copy Markdown
Collaborator

@tomivm tomivm commented Feb 13, 2026

Improve AppContainer to handle visibility changes and resume events, incorporating data refresh logic for logged-in users. Refactor data refresh handling to include debounce logic for synchronization during connectivity changes.

…adding data refresh logic (logs only) for logged-in users
…y changes and app visibility, adding debounce logic for sync operations
…listener management for online/offline states
…vent unnecessary updates when online/offline status is unchanged
@tomivm tomivm requested a review from RodriSanchez1 February 18, 2026 17:54
return;
}

if (!window.navigator.onLine) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why dont you use the isConnected redux state?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

what is the difference?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

there is no difference but we have dedicated state for that, why not using it?

@RodriSanchez1 RodriSanchez1 marked this pull request as ready for review March 17, 2026 21:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates AppContainer to react to app visibility and connectivity changes so it can trigger a data refresh/sync flow when the user returns to the app or regains connectivity.

Changes:

  • Adds online/offline listeners and cleans them up on unmount.
  • Adds visibility (visibilitychange) and Cordova resume (resume) listeners to trigger a refresh hook.
  • Introduces a handleDataRefresh gate with a time-based throttle and wires getApiObjects into mapDispatchToProps (currently not invoked).

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@RodriSanchez1 RodriSanchez1 changed the base branch from master to revert-2113-revert-2097-sync-boards-action March 18, 2026 19:42
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.

3 participants