Skip to content

Conversation

dannimad
Copy link
Contributor

@dannimad dannimad commented Oct 1, 2025

Avoiding refreshing the snapshot on frozen containers by looking at readOnlyInfo.storageOnly, disabling the timer that triggers refresh and simply not going through tryRefreshSnapshot when in storage only.

There is still some work to be done in regards to what should we do when out of storage only mode. Given that is not a priority for version history, we can limit the ability to refresh snapshot at all if we boot from storage only mode and think on how to reactivate the refresh in a follow up.

@Copilot Copilot AI review requested due to automatic review settings October 1, 2025 18:35
@github-actions github-actions bot added area: loader Loader related issues base: main PRs targeted against main branch labels Oct 1, 2025
Copy link
Contributor

@Copilot 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 prevents snapshot refresh on frozen containers by detecting storage-only mode and disabling the refresh mechanism. The change ensures that containers in read-only storage mode do not attempt to refresh snapshots, which is appropriate for frozen containers that should not be modified.

  • Adds a storageOnly parameter to SerializedStateManager to disable snapshot refresh timers and logic
  • Extracts storage-only state from container's readOnlyInfo.storageOnly property
  • Updates all test instantiations to accommodate the new parameter

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/loader/container-loader/src/container.ts Extracts storage-only state and passes it to SerializedStateManager
packages/loader/container-loader/src/serializedStateManager.ts Adds storageOnly parameter and conditional logic to disable refresh functionality
packages/loader/container-loader/src/test/serializedStateManager.spec.ts Updates test constructor calls and adds new test for storage-only behavior

this.storageAdapter,
offlineLoadEnabled,
this,
() => this.isStorageOnly,
Copy link
Contributor

Choose a reason for hiding this comment

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

let's just inline the function here, rather than add single use private getter to the class.

Copy link
Contributor

Choose a reason for hiding this comment

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

also, rather than defaulting to false, we probably want to use undefined, as from undefined it could become true or false, but once it's true or false, it should never change

return this._dirtyContainer;
}

private get isStorageOnly(): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be deleted

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

Labels

area: loader Loader related issues base: main PRs targeted against main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants