Skip to content

Feat/add support for loading expiring private insts - #856

Open
TroyceGowdy wants to merge 14 commits into
developfrom
feat/Add_support_for_loading_expiring_private_insts
Open

TroyceGowdy wants to merge 14 commits into
developfrom
feat/Add_support_for_loading_expiring_private_insts

Conversation

@TroyceGowdy

Copy link
Copy Markdown
Contributor

fixes #849

…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
…or_loading_expiring_private_insts

# Conflicts:
#	CHANGELOG.md
#	src/aux-server/aux-web/aux-player/PlayerHome/PlayerHome.ts
@TroyceGowdy TroyceGowdy added this to the v3.5.x milestone Jun 6, 2026
@TroyceGowdy TroyceGowdy self-assigned this Jun 6, 2026
@TroyceGowdy TroyceGowdy added the enhancement New feature or request label Jun 6, 2026
@TroyceGowdy TroyceGowdy added the area:player Is related to the player frontend. (Everything in aux-server/aux-web/aux-player) label Jun 6, 2026
@github-project-automation github-project-automation Bot moved this to To triage in CasualOS Jun 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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?: boolean flag 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`;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:player Is related to the player frontend. (Everything in aux-server/aux-web/aux-player) enhancement New feature or request

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

Add support for loading expiring private insts

2 participants