Skip to content

chore: [Remote rendering 3.6a] Cleanups after moving authority to server - #165

Draft
LKasianAnsys wants to merge 5 commits into
feat/3.5d-fix-color-by-vector-partfrom
chore/3.6a-clean-up-state
Draft

LKasianAnsys wants to merge 5 commits into
feat/3.5d-fix-color-by-vector-partfrom
chore/3.6a-clean-up-state

Conversation

@LKasianAnsys

@LKasianAnsys LKasianAnsys commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

Addresses #24

Context

Feature #19 is Phase 3 of the remote rendering epic (#15), which moves the viewer state authority from the client to the server. The first 5 user stories in this phase moved ownership of all of the pieces of the viewer state to the server. User story 3.6 is to clean up unused scaffolding and to review the save/load state workflow to ensure it works end to end as expected with the new state authority model.

This PR includes two main cleanups:

  1. Remove the server-to-client round trip that previously asked the client for the viewer state during the save_state API. This includes frontend and backend code that can now be retired, now that the server reads its own records during save_state.
  2. Remove the client-side reapplication of its own cached state during onServerUpdateAsync. Previously, when the server received an API call and triggered an update on the client, the server would push stale viewer state, requiring the client to cache its previous state and reapply it after the server push. This is no longer needed now that the server is the authority on the viewer state.

Manual checks:

  • on add_dataset, viewer state looks correct for the pre-existing dataset. Start viewer with a dataset, color a part by a variable, turn on some widgets, change the camera orientation. Run add_dataset to add a new dataset; check that the first dataset's state, and the state of widgets and camera (and UI panels and tabs) looks as it did.
  • check that save_state works as expected. After the first check above, run the save_state API. Initialize a new VISOR instance, and start it with no dataset. Run load_state to load the previously saved state. Check that it produces the same viewer state as the original VISOR instance.

Copilot summary

This pull request removes the frontend round-trip for saving viewer state, making the server the sole authority for building and persisting the viewer state. The changes simplify the codebase by eliminating now-unnecessary async calls, models, and handlers related to client-side state retrieval. Saving now works even if no client is connected, improving robustness and maintainability.

Major changes include:

Removal of frontend authority and async state retrieval

  • The server now builds the persisted viewer state directly from its own records, removing the need to request state from the frontend. The save_state method in VisorVTK and the get_state method in VisorSceneBase have been refactored to be synchronous and no longer await frontend responses. (F6231c12R364, F738364eR236, F738364eR272)
  • The abstract method _get_runtime_state_async and related frontend round-trip logic have been removed from VisorSceneBase and its subclasses. (F738364eR186, F4dfffcdR41)
  • The save_state_response trigger and handler have been removed from LocalApp and related classes, since the server no longer expects a response from the frontend. (F0d5e153R206, F0d5e153R234, F0d5e153R242, F0d5e153R306, F6887ffeR42, F738364eR405, F4dfffcdR64)

Model and code cleanup

  • The VisorSaveStateRequest and VisorSaveStateResponse models, which were used for client-server state exchange, have been deleted as they are no longer needed. [1] [2]
  • Imports and type checking related to the removed models have been cleaned up. (F738364eR5, F738364eR24, F738364eR35)

@github-actions github-actions Bot added test Work associated with testing miscellaneous labels Oct 8, 2026
@LKasianAnsys
LKasianAnsys changed the base branch from main to feat/3.5d-fix-color-by-vector-part October 8, 2026 17:45
@LKasianAnsys LKasianAnsys changed the title chore: [Remote rendering 3.6a] Clean ups after moving authority to server chore: [Remote rendering 3.6a] Cleanups after moving authority to server Oct 8, 2026

This branch has not been deployed

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

Labels

miscellaneous test Work associated with testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants