Skip to content

fix: settings window rendering/loading issue#889

Merged
SteveLauC merged 1 commit intomainfrom
preferences-window-missing-0827
Aug 28, 2025
Merged

fix: settings window rendering/loading issue#889
SteveLauC merged 1 commit intomainfrom
preferences-window-missing-0827

Conversation

@SteveLauC
Copy link
Copy Markdown
Member

@SteveLauC SteveLauC commented Aug 27, 2025

This commit fixes(I guess?) the issue that the Settings window may not be
rendered or loaded, you will see that the whole window is gray in that case.

Background, aka, why this issue exists

In commit 1, we wrapped all the backend setup routines in a tauri command, so
that frontend code can call it before invoking any other backend interfaces to
guarantee that these interfaces won't be called until the data/state they rely
on is ready.

The implementation in 1 had an issue that it didn't work with window reloading.
To fix this issue, we made another commit 2. Commit 2 fixed the refresh
issue, but it also caused the settings window issue that this commit tries to fix.

The backend setup tauri command needs a state to track whether the setup has
completed. In the previous implementation, this was done in the frontend. In
this commit, it is moved to the backend.

Why didn't you guys move that state to backend in previous commits, e.g., commit 2?

We tried, but failed. In the previous tries, the backend would send an event
to the frontend, but the frontend couldn't receive it, for reasons we still
don’t understand. And this weird issue still exists, we just happen to find
a way to work around it.

Standards checklist

  • The PR title is descriptive
  • The commit messages are semantic
  • Necessary tests are added
  • Updated the release notes
  • Necessary documents have been added if this is a new feature
  • Performance tests checked, no obvious performance degradation

@SteveLauC SteveLauC changed the title Preferences window missing 0827 fix: settings window rendering/loading issue Aug 27, 2025
@SteveLauC SteveLauC force-pushed the preferences-window-missing-0827 branch from f94b5ff to 478adf9 Compare August 27, 2025 07:26
This commit fixes(I guess?) the issue that the Settings window may not be
rendered or loaded, you will see that the whole window is gray in that case.

Background, aka, why this issue exists
=============================================================

In commit [1], we wrapped all the backend setup routines in a tauri command, so
that frontend code can call it before invoking any other backend interfaces to
guarantee that these interfaces won't be called until the data/state they rely
on is ready.

The implementation in [1] had an issue that it didn't work with window reloading.
To fix this issue, we made another commit [2].  Commit [2] fixed the refresh
issue, but it also caused the settings window issue that this commit tries to fix.

The backend setup tauri command needs a state to track whether the setup has
completed.  In the previous implementation, this was done in the frontend.  In
this commit, it is moved to the backend.

Why didn't you guys move that state to backend in previous commits, e.g., commit [2]?
=============================================================

We tried, but failed.  In the previous tries, the backend would send an event
to the frontend, but the frontend couldn't receive it, for reasons we still
don’t understand.  And this weird issue still exists, we just happen to find
a way to work around it.

[1]: f93c527
[2]: 993da9a

Co-authored-by: ayang <473033518@qq.com>
@SteveLauC SteveLauC force-pushed the preferences-window-missing-0827 branch from 478adf9 to bbf7dcb Compare August 27, 2025 07:30
@SteveLauC SteveLauC marked this pull request as ready for review August 27, 2025 07:31
@SteveLauC SteveLauC merged commit efaaf73 into main Aug 28, 2025
7 checks passed
@SteveLauC SteveLauC deleted the preferences-window-missing-0827 branch August 28, 2025 01:01
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