Feat/add support for loading expiring private insts - #856
Open
TroyceGowdy wants to merge 14 commits into
Open
TroyceGowdy wants to merge 14 commits into
TroyceGowdy wants to merge 14 commits into
Conversation
…nce layers - add optional expires flag to inst/branch/package/websocket watch contracts - make split store and websocket routing use expires semantics (not recordName alone) - prevent non-expiring public inst watch requests - skip expiring/public branches in savePermanentBranches() - exclude expiring insts from totalInsts metrics (memory, prisma, sqlite) - persist and read inst expires in prisma/sqlite inst stores - add schema updates for InstRecord.expires in prisma + sqlite schemas - add focused split/websocket tests for expires=true/false behavior
- prevent watchBranch from accepting explicit expires values that conflict with a saved inst's expires state - treat missing saved expires as false when validating - return invalid_request when requested expires does not match existing inst - add inst existence metadata to get-or-create flow to distinguish existing vs newly created insts - add regression test to ensure mismatched expires requests do not create temp or permanent branches
- add expiring BIOS variants for private/studio (and inst aliases) - parse and honor expires=true from URL inst parameters - pass expires through player load flow into watch branch requests - extend simulation/partition config to carry expires for remote yjs - update BIOS labels/descriptions for expiring options in player UI - expose new expiring BIOS options in studio player-config selectors
… expires behavior
…or_loading_expiring_private_insts # Conflicts: # CHANGELOG.md # src/aux-server/aux-web/aux-player/PlayerHome/PlayerHome.ts
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends CasualOS’s inst-loading flow (AUX player → VM → websocket records backend) to support expiring private/studio insts, primarily by propagating an expires flag through simulation options/config, websocket messages, and storage/metrics layers.
Changes:
- Add an
expires?: booleanflag to simulation origin/options and propagate it into remote Yjs partition watch requests. - Persist and route expiring inst/branch/package metadata across stores (Prisma/SQLite + split temp/permanent store) and exclude expiring insts from subscription metrics.
- Add AUX player URL + BIOS support for expiring private/studio inst options, plus related tests/snapshots/changelog.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/aux-vm/portals/HtmlAppBackend.spec.ts | Makes the HTML app update assertion less order-dependent. |
| src/aux-vm/managers/SimulationManager.ts | Adds expires?: boolean to simulation factory options. |
| src/aux-vm/managers/Simulation.ts | Adds expires?: boolean to SimulationOrigin. |
| src/aux-vm-browser/managers/BotManager.ts | Propagates expires into remote partition config (affects watch messages). |
| src/aux-server/shared/SimulationHelpers.ts | Includes expires in simulation ID generation. |
| src/aux-server/aux-web/shared/AppManager.ts | Threads expires into primary simulation creation/update. |
| src/aux-server/aux-web/aux-player/UrlUtils.ts | Parses expires (and expiring BIOS options) from URL query. |
| src/aux-server/aux-web/aux-player/UrlUtils.spec.ts | Adds tests for expires parsing and expiring BIOS options. |
| src/aux-server/aux-web/aux-player/PlayerHome/PlayerHome.ts | Adds expiring BIOS options + passes expires through to simulation loading. |
| src/aux-server/aux-web/aux-auth/site/AuthStudio/AuthStudio.vue | Adds expiring BIOS options to studio auth UI selects. |
| src/aux-server/aux-backend/schemas/sqlite/auth.sqlite.prisma | Adds expires field to SQLite InstRecord. |
| src/aux-server/aux-backend/schemas/auth.prisma | Adds expires field to main InstRecord. |
| src/aux-server/aux-backend/prisma/sqlite/SqliteMetricsStore.ts | Excludes expiring insts from inst count metrics. |
| src/aux-server/aux-backend/prisma/sqlite/SqliteInstRecordsStore.ts | Loads/saves InstRecord.expires in SQLite store and list APIs. |
| src/aux-server/aux-backend/prisma/PrismaMetricsStore.ts | Excludes expiring insts from inst count metrics. |
| src/aux-server/aux-backend/prisma/PrismaInstRecordsStore.ts | Loads/saves InstRecord.expires in Prisma store and list APIs. |
| src/aux-records/websockets/WebsocketController.ts | Adds expires semantics to watch/create flows, branch routing, and saving behavior. |
| src/aux-records/websockets/WebsocketController.spec.ts | Adds coverage for public expires:false rejection and expiring private routing/mismatch. |
| src/aux-records/websockets/SplitInstRecordsStore.ts | Routes expiring entities to temp store and avoids persisting expiring insts. |
| src/aux-records/websockets/SplitInstRecordsStore.spec.ts | Adds tests for expiring routing behavior in split store. |
| src/aux-records/websockets/InstRecordsStore.ts | Extends store record interfaces with optional expires. |
| src/aux-records/MemoryStore.ts | Excludes expiring insts from in-memory metrics calculations. |
| src/aux-records/snapshots/RecordsServer.spec.ts.snap | Updates snapshots for expanded BIOS option set. |
| src/aux-common/websockets/WebsocketEvents.ts | Adds optional expires to repo/watch_branch message + schema. |
| src/aux-common/partitions/RemoteYjsPartition.spec.ts | Adds test ensuring watch request includes expires: true when configured. |
| src/aux-common/partitions/AuxPartitionConfig.ts | Adds expires?: boolean to RemoteYjsPartitionConfig. |
| src/aux-common/documents/SharedDocumentConfig.ts | Adds expires?: boolean to shared document config. |
| src/aux-common/documents/RemoteYjsSharedDocument.ts | Propagates expires into watch-branch websocket message. |
| src/aux-common/common/WebConfig.ts | Extends BIOS option type/schema/docs for expiring options. |
| CHANGELOG.md | Updates changelog entry to describe expiring private inst support. |
Comment on lines
+226
to
+228
| ...(typeof origin.expires === 'boolean' | ||
| ? { expires: origin.expires } | ||
| : {}), |
Comment on lines
+244
to
+246
| ...(typeof origin.expires === 'boolean' | ||
| ? { expires: origin.expires } | ||
| : {}), |
Comment on lines
+263
to
+265
| ...(typeof this._expires === 'boolean' | ||
| ? { expires: this._expires } | ||
| : {}), |
Comment on lines
+331
to
339
| if (isExpiringPrivateBiosOption(option)) { | ||
| if ( | ||
| option === 'private-expires' || | ||
| option === 'private inst-expires' | ||
| ) { | ||
| return `private ${DEFAULT_EXPIRING_INST_HOURS}h`; | ||
| } | ||
| return `studio ${DEFAULT_EXPIRING_INST_HOURS}h`; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #849