Commit Graph

231 Commits

Author SHA1 Message Date
Alexa 936aa061c0 test: guard both schema-delivery paths; fix playlist backfill defaults
Adds SchemaBootstrapParityTests, which closes the hole that let the
missing-column outage ship green. Every other test runs against a FRESH
database where EnsureCreated builds the whole model from the entities, so a
column that only exists in the model always appears — the failure mode is
invisible by construction. These two tests model an EXISTING database instead:

- Every model table/column must be reachable via a committed migration OR an
  idempotent Ensure* patch. Something covered by neither reaches only brand-new
  databases, and every query touching it throws on a deployed server.
- Anything added after the Initial migration must additionally appear as a
  Postgres ALTER/CREATE in DatabaseBootstrap, because that path is
  EnsureCreated-only and never replays migrations. This is precisely the rule
  PrivateInstances.RoomCode, Clubs.ClubChatEnabled and
  ChatMessages.ModerationState broke.

The first test asserts the union rather than migrations alone: a large amount of
schema legitimately predates the rule and lives only in the helpers. Tightening
that is separate cleanup; what must never happen is a column covered by nothing.

The helper-coverage parser reads the Ensure* SQL out of the source rather than
executing the private methods, and handles both C# string styles the file mixes
plus the loops that interpolate a column name (EnsureGameRewardColumnsAsync).

Also fixes a real data bug found in review: the Client2023WireFixes migration
backfilled SupportsJuniors/SupportsScreens/SupportsTeleportVR/SupportsWalkVR to
false for existing rows, while the entity default is true. A C# property
initializer is not a database default, so EF emitted false and every playlist
predating the migration would have been silently marked as not supporting
juniors, screens or either VR movement mode — the opposite of intent, and
inconsistent with the bootstrap helper, which already used true.
2026-07-28 09:42:48 +03:00
Alexa 81698180dd fix: add the new 2023-wire columns to the idempotent schema bootstrap
Adding entity columns and an EF migration was not enough, and the gap took
down a live dev server: club home, matchmake/dorm, the presence heartbeat and
the chat thread list all returned 500 with "column does not exist".

The Postgres path is EnsureCreated-only and never replays migrations, so an EF
migration adds nothing to a database that already exists. Every post-Initial
column has to be repeated as an idempotent ALTER in DatabaseBootstrap — that is
what the existing Ensure*Columns helpers are for — and the columns added by the
2023 wire work had no such helper.

Observed failures, all from a running deployment:

- PrivateInstances.RoomCode  -> PrivateInstanceService.EnsureForDormAsync,
  which is on the path of BOTH matchmake/dorm and player/heartbeat. This is
  why the client could not load into the dorm at all.
- Clubs.ClubChatEnabled / MinLevel -> ClubService.HomeClubAsync, so
  GET club/home/me 500'd on every boot.
- ChatMessages.ModerationState -> ChatController.GetThreads, so the chat
  inbox 500'd.

EnsureClient2023WireColumnsAsync covers all of them plus the playlist settings
columns and the two new club tables, for Postgres and SQLite, and runs after
the provider branch so both get it. Every statement is idempotent, so it is a
no-op on a fresh database that EnsureCreated already built correctly.

The test suite did not catch this because tests always run against a fresh
database, where EnsureCreated builds the full model from the entities. Only an
EXISTING database can be missing these columns.
2026-07-28 09:31:10 +03:00
Alexa 933c7eb51c feat: close the last route gaps — 100% client route+verb coverage
Every HTTP request the 2023-03-21 client can issue now reaches a handler under
the verb it actually uses: 522/522, with an empty KnownGaps allowlist. The
coverage test asserts it, so a regression fails the build rather than becoming
a 404 in the wild.

The six routes left after the previous pass all needed storage that did not
exist, so they are done here as one schema change rather than stubbed:

- ClubRolePermissionEntity (ClubId, MembershipType, six bools) backs
  PUT club/{id}/permissions/{role}. A club with no stored row falls back to the
  derived default policy, so every club that predates the table behaves exactly
  as before. Partial writes keep the values they currently resolve to, so a
  client that omits a field cannot silently revoke a permission.
- ClubAdditionalImageEntity (ClubId, Slot, ImageName) backs the gallery. The
  details envelope now emits real {ImageName, Slot} rows instead of an empty
  array, and DELETE clears a slot.
- ClubEntity.MinLevel and ClubEntity.ClubChatEnabled back their setters and are
  read back by hasDisabledClubChat and the Club wire shape, which previously
  reported hardcoded defaults.
- ChatMessageEntity.ModerationState backs PUT thread/message/{id}/moderate,
  gated so an author can retract their own message but only club moderators and
  admins can action anyone else's.
- TestCaseEntity.CommentsJson backs the QA comment endpoint, appending rather
  than overwriting so a second tester's note cannot erase the first.

Also corrects the Joinability comment on ClubEntity, which documented
1=RequestToJoin / 2=InviteOnly. The real enum is Open=0, InviteOnly=1,
AskToJoin=2 — the inverted reading the requesttojoin handler was already fixed
away from, left behind where it could mislead the next change.
2026-07-28 09:19:35 +03:00
Alexa 4b5086cdf1 feat: implement the client routes that had no handler
Sixteen agents, one controller each, over every route the coverage test
reported as missing or wrong-verb. Route+verb coverage is now 516/522 (98.9%),
up from 90.8%.

Each handler was written against binary evidence rather than the audit's prose:
verb from the BestHTTP.HTTPMethods ordinal at the call site, response shape from
the issuing method's return type, request shape from whether the client uses
form fields, a raw JsonUtility body, or query params. Agents were told to skip
rather than stub, and several did.

New surface worth noting:

- Link host: actionlink create/get/consume and datalink get/put, previously
  unrouted entirely.
- Club roster reads: members, banned, requests, requests/search, members/search,
  each with the client's real sort/paging params and the wire row shape its
  reader expects (the banned row has no MembershipType field, so it isn't sent).
- Home clubhouse set/clear, club disband (soft, via the existing State column),
  and DELETE mainimage as its own action rather than a verb alias — the client
  parses the details envelope from it, so it is not status-only.
- Club chat threads, comment CRUD, keepsake collect/delete, progression-event
  xp boosts, image report and cheered/bulk, iOS StoreKit product reporting.

The six routes still missing all need storage that does not exist yet
(per-role club permissions, club additional-image slots, MinLevel,
ClubChatEnabled). Those are left for a single schema change rather than faked.

Also excludes DELETE /account/me from the endpoint contract probe. That route is
now a real, correctly-guarded account purge, and the probe walks every route
with one test player — so calling it destroyed the probe's own session and
turned one real event into 49 cascading foreign-key and 401 failures.
2026-07-28 09:11:26 +03:00
Alexa 90e069ee4b fix: second pass over the 2023-client wire defects, plus a coverage harness
Fourteen agents worked one server file each over the audit's open findings,
re-verifying every claim against the client binary before changing anything.
Route+verb coverage against the recovered client inventory is now 474/522
(90.8%), up from 86.2% when the harness was first wired up.

Adds ClientRouteCoverageTests, which turns "are we compliant?" into a number
instead of an opinion. It reads data/client-routes-2023.tsv — every request the
2023-03-21 client can issue, recovered from the binary — and asserts each one
has a handler under the verb the client actually uses, separating "no handler"
from "handler exists, wrong verb" since those have different fixes. Remaining
gaps live in KnownGaps, which is expected to shrink and never grow.

Also fixes a real blind spot in EndpointContractDiscovery: it only collected
HttpMethodAttribute, so an action carrying a bare [Route] with no verb attribute
was invisible to it. The CDN's unity_assets handler is exactly that shape, which
had been showing up as a phantom gap.

Notable findings from this pass:

- The club permissions envelope key is literally "Type", not "MembershipType"
  as the audit's suggested fix guessed. Read off the generated reader, then
  cross-checked against the 2020 decompile — the int bitmask we were emitting
  was wrong for BOTH client generations, not just 2023.
- Room-consumable purchase responses carry OperationResult as an OBJECT
  { Status, InventoryItem }; the scalar operation enum belongs in
  BalanceUpdateResult. The base type OKHNOPLBOFP holds a single BGHBAILNNJJ,
  which exposes exactly those two properties. A test asserting the old scalar
  shape was corrected rather than the code.
- buyProgressionEventXpBoost blind-inserted an ObjectiveProgress row whose
  (PlayerId, Key) is unique, so a second purchase of the same boost threw
  "UNIQUE constraint failed" and 500'd AFTER taking the player's currency.
  Now an upsert.

Agents were forbidden from faking fixes they could not complete in their own
file, and several correctly refused: club role permissions, club additional
image slots, announcement meta, MinLevel/ClubChatEnabled, currency purchase
offer ordering, and room-key image/currency columns all need new entities or
columns. Those are deliberately left for a single coherent schema change rather
than stubbed out here.
2026-07-28 08:50:58 +03:00
Alexa 289072583e feat: Enhance room management and moderation APIs
- Added support for multiple tag filters in HotRoomServer endpoint, allowing clients to query hot rooms with multiple tags.
- Introduced a new DeleteRoom endpoint for owners to soft-archive their rooms, ensuring room data integrity.
- Updated MagicDoor endpoint to return a structured response including refresh timing.
- Improved reporting functionality to handle form submissions correctly, ensuring room reports are persisted.
- Refactored per-field mutation endpoints to support both legacy and new client formats, accommodating changes in request structure.
- Implemented a multi-field payload reader to handle complex requests more efficiently.
- Enhanced logging for room code management to track player actions and conflicts.
2026-07-27 23:54:25 +03:00
Alexa 49df7393dc fix: push presence when a player comes back online
OnDisconnectedAsync told friends a player went offline, but nothing ever
pushed the opposite transition — PlayerCameOnline existed in
NotificationService with zero callers. The pair was asymmetric, so a SignalR
reconnect (network blip, replica restart) greyed the player out on every
friend's list for the rest of the session even though they were still
playing. Only re-entering a room, which pushes presence via /goto, brought
them back.

AddConnectionAsync already computed the first-connection transition to
maintain the online set but returned void; it now reports it, mirroring
RemoveConnectionAsync.

The push is deliberately conditional on a room already being known. The
presence payload derives isOnline from roomInstance being non-null, so
pushing with no room reads as OFFLINE — worse than staying quiet. On a fresh
boot there is no room yet and the /goto that follows sends the real presence
anyway, so this only fires on reconnects, where the cached room is exactly
what friends need to see again.
2026-07-27 23:40:11 +03:00
Alexa 327dcb789c fix: correct 2023-03-21 client wire contracts across the API and notify surfaces
Audits every route the March-2023 client can call against what this server
actually serves, and fixes the defects that were breaking gameplay. Adds
docs/recroom-2023-client-api-complete.md as the reference: ~500 route
literals across 13 subsystems, with verb, request/response shape, and a
per-subsystem diff. 315 defects catalogued; the ones fixed here are listed
in its "Already fixed" table.

Path coverage was never the problem — 465 of 506 routes already had
handlers. The failures were in shape, and they cluster into four causes:

- Wrong verb. The verb is a BestHTTP.HTTPMethods ordinal (GET=0 .. PATCH=5),
  confirmed from that enum's static constructor. Routes registered POST-only
  while the client PUTs returned 405, which made room consumables neither
  buyable nor consumable and blocked every room-key edit.
- Bare scalar wrapped in an object. The client reads `1000`, not
  `{"Limit":1000}`; the issuing method signature says which. Wrapping makes
  the deserializer throw and the feature dies silently.
- [FromBody] vs form-urlencoded. The client sends nearly every write as form
  data, which an [ApiController] action bound [FromBody] rejects with 415
  before the handler runs. This alone broke all 13 club member-management
  endpoints. Adds Binding/FormOrJsonModelBinder so this is fixed once.
- Notify dispatch keys. Both enum overloads of the client's RegisterHandler
  lower the id via Int32.ToString() and register only that numeric key, and
  lookup is a case-sensitive TryGetValue that returns silently on a miss. We
  were sending the enum NAME for most ids, so friend-request updates, forced
  logout, maintenance broadcasts, live balance and consumable updates, and
  invention moderation pushes all evaporated with no error anywhere.

Notable behavioural bugs fixed:

- Editing a club announcement deleted it: PUT was a third binding on the
  delete handler. Split apart, and the missing create route added.
- leaderboard/CheckAndSetStat did not exist. The 2023 client has no SetStat
  literal at all, so every leaderboard score it wrote was discarded.
- Setting a club clubhouse cleared it: the handler read roomId from the query
  while the client sends it in the body, then wrote the resulting null.
- Club join requests were inverted (the enum is Open=0, InviteOnly=1,
  AskToJoin=2), so ask-to-join clubs rejected everyone and invite-only clubs
  quietly admitted them.
- Room bans were pushed as id 24, for which the client registers no handler;
  they now go out as ModerationKick with IsBan, so the ban takes effect
  immediately instead of at next login.
- Room-key ownership queries answered for the wrong player, and "has anyone
  bought this key" asked "did I buy it" — always false for the creator.

Also persists settings that were previously acknowledged and dropped
(playlist accessibility/restrictions/level-voting/warning, per-player status
visibility, VR movement mode and avoid-juniors, custom room codes), which is
what the new columns in the migration are for.

One test asserted the old nested PriceAndCurrency response shape; the
client's consumable formatter has no such key and reads Price and
PurchaseCurrencyId flat, so the test was corrected alongside the handler.
2026-07-27 23:27:23 +03:00
Alexa 674a3fc257 feat: Update room version clamping logic; adjust maximum persisted room version for March-2023 client compatibility 2026-07-17 00:16:54 +03:00
Alexa e93bbb14cb feat: Implement room blob version clamp toggle; add settings endpoint and UI support for managing version clamping of imported rooms 2026-07-16 23:34:55 +03:00
Alexa 618bcd9203 feat: Update quest team size handling; correct method references for GameConfigurationAsset and GameSpawnManager 2026-07-16 00:19:22 +03:00
Alexa 6d78b7b115 feat: Update API and documentation to ensure sub-room saves return a paged object; fix deserialization issues for the 2023 client 2026-07-13 12:23:18 +03:00
Alexa 6ee018b844 feat: Implement private room cloning and instance management; ensure cloned rooms start private and funnel joins into a single instance 2026-07-13 12:10:12 +03:00
Alexa 690e77f520 feat: Enhance room cloning functionality; add support for roomserver routes and blob management for first-party templates 2026-07-13 11:51:20 +03:00
Alexa e4126e38ce feat: Inherit IsAGRoom property from source for proper cloning of RRO rooms; ensure compatibility with baked geometry loading 2026-07-13 01:16:54 +03:00
Alexa a2ffb5ef4b feat: Update room properties to support cloning for RRO/AG base rooms; adjust moderation logic for cloning permissions 2026-07-13 01:04:10 +03:00
Alexa 1152d9ba48 feat: Update room cloning API to accept multiple content types for name input; enhance compatibility with 2023 client 2026-07-13 01:00:00 +03:00
Alexa 5460cc3601 feat: Add regression tests for room cloning functionality; ensure cloned rooms return full details 2026-07-13 00:54:12 +03:00
Alexa 2c749c2677 feat: Implement base room management; add API endpoints for retrieving and setting curated base rooms 2026-07-13 00:40:35 +03:00
Alexa 2795d2ed7d feat: Enhance room cloning functionality; ensure cloned rooms include source scenes for complete structure 2026-07-13 00:15:57 +03:00
Alexa 757308b44d feat: Update PlayerCheer and Avatar handling; enhance API responses and add new fields for 2023 client compatibility 2026-07-12 23:54:11 +03:00
Alexa 3d7d7ebdf1 feat: Enhance API endpoints and add new features
- Added support for v3 gift generation in AvatarGiftsController.
- Updated club report messages to include club IDs for better tracking in CompatibilityFeatureController.
- Introduced new endpoints for voice moderation and whitelisted emojis in ConfigController.
- Modified image retrieval logic to support single image lookups by name in ImagesController.
- Adjusted incentivized referrals to return an empty array when no rewards are available in IncentivizedReferralsController.
- Implemented trial invention functionality in InventionsController.
- Added top creators today endpoint in PlayerSubscriptionsController.
- Expanded room earnings distribution functionality in RoomEarningsDistributionsController.
- Enhanced room search capabilities with pagination in RoomsController.
- Improved account name generation options in AccountsController.
- Added party invite privacy settings in PlayerSettingsController.
- Created CommentsController for handling unread comment counts.
- Established PurchaseCampaignController for handling purchase campaign telemetry.
2026-07-12 22:18:58 +03:00
Alexa 5fcef3ffe7 feat: Remove unnecessary push notifications for avatar updates in AdminController; update comments for clarity 2026-07-12 13:18:32 +03:00
Alexa 28b5d5525b feat: Refactor notification handling to use SystemNotificationService; remove outdated NotificationService references and update related logic 2026-07-12 12:47:29 +03:00
Alexa 35ef784bd9 feat: Update notification handling to prevent account DTO issues; add SystemNotificationService for event notifications 2026-07-12 12:43:09 +03:00
Alexa 63e3b11736 feat: Enhance avatar gifts and items handling; normalize gift descriptions and include color variants with unique IDs 2026-07-12 00:54:01 +03:00
Alexa c472e7f342 feat: Update gift handling to ensure AvatarItemDesc matches v4/items format; prevent duplicate wardrobe entries 2026-07-12 00:33:55 +03:00
Alexa 1a946f3023 feat: Add AvatarItemId, TagList, and IsBaseAvatarItem to owned avatar items; implement stable ID generation and corresponding tests 2026-07-10 00:08:10 +03:00
Alexa e27b06ce5b feat: Implement "everyone owns all avatar items" toggle; update server settings, controller logic, and admin UI 2026-07-09 11:37:47 +03:00
Alexa 479ea273ea fix: Revert room-details DTO extras that broke room parsing
af0d7b6 added RankingContext/DataBlob/MaxPlayers/ToxmodEnabled to the
shared BuildRoomServerDetails (and DataBlobHash/Description to
BuildStudioSaveWire) to try to satisfy the 2023 SaveRoom commit-response
Dispose walk. The invented RankingContext object shape is rejected by
the strict room-details mapper, so GET rooms/{id} (and every room list
that shares the builder) failed with "Malformed Response" -> rooms
broke. The 2023 mappers validate value SHAPES, not just key presence, so
bolting unverified keys onto the shared room DTO is unsafe.

Reverts af0d7b6 code changes. Room saving remains functionally correct
(blob persists, fanout delivers); the SaveRoom success toast is left for
a separately-verified fix.
2026-07-08 20:33:39 +03:00
Alexa af0d7b6c20 feat: Enhance room save flow documentation and tests to ensure all required fields are present; update validation logic for Room and SubRoomDataSave 2026-07-08 03:15:06 +03:00
Alexa 4021f7c6e0 feat: Update RoomInstance handling to serialize roomInstanceId as string for JSON compatibility; add tests to ensure correct behavior 2026-07-08 03:04:45 +03:00
Alexa 74951d5c30 feat: Implement quest reward chest functionality; enhance gift generation and consumption logic, update database schema, and add tests for new behavior 2026-07-08 02:40:42 +03:00
Alexa 892c27ffea feat: Implement quest reward system with item selection and storage; update related services and database schema 2026-07-08 01:51:55 +03:00
Alexa 0defa37928 feat: Implement consumables support in StoreService and add related tests; include new consumables data 2026-07-08 01:33:29 +03:00
Alexa f23df2659d feat: Update Images and Rooms APIs to support 2023 client URL structure and add tests for new functionality 2026-07-08 01:29:54 +03:00
Alexa 1417651c77 feat: Enhance room save flow with new metadata handling and add tests for 2023 client integration 2026-07-08 01:19:19 +03:00
Alexa a18236d064 fix: Correct AvatarItemId type handling to prevent malformed responses in storefront payload 2026-07-08 01:04:51 +03:00
Alexa 3d2deeedf8 fix: Update AvatarItemId handling to ensure correct data type and prevent malformed responses in Shop tab 2026-07-08 01:04:39 +03:00
Alexa 7b7eb651e3 feat: Add tests for 2023 watch shop tab and room consumables; implement new storefront endpoint and update documentation 2026-07-07 23:27:13 +03:00
Alexa 8e87a9de82 feat: Implement Room Consumables API with CRUD operations and purchase logic; add tests for end-to-end coverage 2026-07-07 14:42:05 +03:00
Alexa fc60c9bf40 Refactor URL coverage documentation and update StoreService for color variants
- Updated `url-coverage.md` to clarify the behavior of the `api/rooms/v2/myRecent` endpoint.
- Enhanced `StoreService.cs` to include new properties for color variants: `combination_id` and `descriptor`.
- Modified logic in `StoreService` to validate color variants based on the new descriptor instead of swatch GUID.
- Updated database bootstrap scripts to create new tables for `RoomConsumables` and `RoomConsumableOwnership`, including necessary indexes.
- Revised README to reflect changes in debugging options and the introduction of `DorkNet.DebugMod`.
- Updated documentation on request expectations to clarify server-side behavior for room visibility.
- Enhanced installation script to provide clearer instructions for enabling the debug console.
- Added a new document detailing the process for dumping avatar items and color variants from the Rec Room client.
2026-07-07 14:28:40 +03:00
Alexa 9a1af3a99d data: add 66 color variants from runtime catalog dump (566 to 632)
Runtime AvatarCatalogDumpMelon dump surfaced item->swatch pairings the
static bundle scan's (slot,name) matcher missed. Kept only the 66 that
map a swatch 1:1 to a single color combination (unambiguous store tile
key); the remaining shared-swatch/multi-color items need a richer variant
model and are deferred. Purely additive.
2026-07-07 13:48:55 +03:00
Alexa a8d7ab4944 feat: Add tests for room visit visibility and bootstrap logic; update versioning and image references 2026-07-03 22:05:20 +03:00
Alexa 111ee6a548 data: add 147 color variants from full March bundle scan (419 to 566)
Scanned all 6365 StreamingAssets/aa bundles for *_Combination
MonoBehaviours, parsed each name (Item_Slot_Colour) plus its
{combinationId},{swatchGuid} pair, and matched to the 882-item catalog
by exact (slot,name). Yields 147 new colored variants beyond the
prior name-prefix pass. Purely additive; the store seeds the new
wardrobe-colored-* tiles on restart.
2026-07-03 17:59:02 +03:00
Alexa 77e5ef5678 Merge branch 'march-2023-03-21' of https://github.com/DorkSquadRR/DorkNet into march-2023-03-21 2026-07-02 10:37:36 +03:00
Alexa 0986a0a118 feat: Enhance room image handling by introducing default image and updating display logic; add unit tests for image resolution 2026-07-02 10:37:34 +03:00
Alexa 628f430645 Add Charades word lists management, profanity filter, and matchmaking routes (#41)
* feat: add 3D Charades word lists management and profanity filter toggle

- Implemented Charades word lists management in the admin UI, allowing for unlimited named word lists with difficulty settings.
- Added functionality to bind live card slots to specific word lists, with automatic fallback to built-in lists.
- Introduced a profanity filter toggle in server settings, enabling or disabling the server-side profanity filter.
- Updated database schema to support new features, including additional columns for profanity filter status and charades slot bindings.
- Enhanced documentation to reflect new features and their usage.

* feat: add identityserver-signing.pfx to .gitignore

* feat: add new matchmake routes for player, event, club, and code
2026-07-02 10:11:18 +03:00
Alexa fbfabaf26e feat: Update README with branch version and single-server defaults; enhance inventory and room handling for equipped items 2026-06-28 02:15:58 +03:00
Alexa 7da20f2047 feat: Update appVersion to 2023.03.21 and enhance avatar-item linkage in store service 2026-06-28 01:31:21 +03:00