Skip to content

fix(weather): avoid loading state after reconnect#4121

Open
KristjanESPERANTO wants to merge 1 commit intoMagicMirrorOrg:developfrom
KristjanESPERANTO:weather/reconnect
Open

fix(weather): avoid loading state after reconnect#4121
KristjanESPERANTO wants to merge 1 commit intoMagicMirrorOrg:developfrom
KristjanESPERANTO:weather/reconnect

Conversation

@KristjanESPERANTO
Copy link
Copy Markdown
Collaborator

When a client reconnects while the backend is still in its rate-limit protection phase, the weather module has no data to show and stays on Loading... until the next scheduled API call. This mainly affects server mode setups, where the server keeps running while a remote client temporarily loses its connection and reloads. It was raised in the forum and is worthy of a fix to improve the user experience.

With this PR the node helper caches the last successful WEATHER_DATA payload per instance and replays it immediately on reconnect. The client gets its last known state right away instead of waiting for the next fetch. The cache is cleaned up when the provider stops.

Tests are included to cover reconnect with and without cached data, and the cleanup path.

@sdetweil
Copy link
Copy Markdown
Collaborator

We are always providing server mode functionality.

@KristjanESPERANTO
Copy link
Copy Markdown
Collaborator Author

Yes, but what’s your point in the context of this PR?

@sdetweil
Copy link
Copy Markdown
Collaborator

You said applies in server mode. We always have server. Even the electron launches as client

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