Skip to content

fix(player-mock): Give PlayerMockService its own type so callers do not need a cast - #819

Open
Quenty wants to merge 1 commit into
mainfrom
users/quenty/player-mock-service-type
Open

fix(player-mock): Give PlayerMockService its own type so callers do not need a cast#819
Quenty wants to merge 1 commit into
mainfrom
users/quenty/player-mock-service-type

Conversation

@Quenty

@Quenty Quenty commented Sep 2, 2026

Copy link
Copy Markdown
Owner

PlayerMockService annotated CreatePlayer's self parameter as PlayerMockServiceBase, but the module table it is called on carries no instance fields of its own, so serviceBag:GetService(PlayerMockService):CreatePlayer() never typechecked and every call site in this repo and in consuming repos had to launder the service through any first. Declaring the module table as its own exported type, intersected with the base so the inherited methods still resolve, makes those calls typecheck directly without a cast.

This is types only and changes nothing at runtime. The same latent issue exists on PlayerMockServiceClient, but fixing it there means reshaping its Init override to keep the base signature, so I left it for a follow-up.

…ot need a cast

CreatePlayer annotated its self parameter as PlayerMockServiceBase while the module
table PlayerMockService itself carries no instance fields, so every call site had to
launder the service through any to typecheck. Declare the module table as its own
exported type intersected with the base, which keeps the inherited base methods
resolving and lets serviceBag:GetService(PlayerMockService):CreatePlayer() typecheck
directly. Types only, no runtime change.
@Quenty
Quenty deployed to integration September 2, 2026 07:59 — with GitHub Actions Active
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Deploy Results

Package Status Try it
@quenty/integration ✅ Deployed (v217) (2.5s) Open | Play

1 package deployed, 1 passed, 0 failed in 3.4s · View logs

Test Results

Package Status Try it
@quenty/playermock ⚠️ Passed (407/407) - logs lost (2.1s) Open | Play
@quenty/access ✅ Passed (311/311) (4.0s) Open | Play
@quenty/camera ✅ Passed (56/56) (1.4s) Open | Play
@quenty/ik ✅ Passed (3/3) (1.1s) Open | Play
@quenty/ragdoll ✅ Passed (12/12) (1.7s) Open | Play
@quenty/brine ✅ Passed (88/90) (1.1s) Open | Play
@quenty/characterutils ✅ Passed (52/52) (1.5s) Open | Play
@quenty/clipcharacters ✅ Passed (1/1) (867ms) Open | Play
@quenty/coreguienabler ✅ Passed (5/5) (1.0s) Open | Play
@quenty/deathreport ✅ Passed (4/4) (868ms) Open | Play
@quenty/playerutils ✅ Passed (36/36) (1.1s) Open | Play
@quenty/chatproviderservice ✅ Passed (9/9) (1.5s) Open | Play
@quenty/gameconfig ✅ Passed (12/12) (1.5s) Open | Play
@quenty/gameproductservice ✅ Passed (92/92) (2.1s) Open | Play
@quenty/permissionprovider ✅ Passed (68/68) (1.5s) Open | Play
@quenty/cmdrservice ✅ Passed (8/8) (1.3s) Open | Play
@quenty/clienttranslator ✅ Passed (176/176) (2.1s) Open | Play
@quenty/inputkeymaputils ✅ Passed (6/6) (1.3s) Open | Play
@quenty/scoredactionservice ✅ Passed (107/107) (2.4s) Open | Play
@quenty/settings-inputkeymap ✅ Passed (1/1) (1.4s) Open | Play
@quenty/datastore ✅ Passed (386/386) (44.0s) Open | Play
@quenty/saveslot ✅ Passed (242/242) (9.1s) Open | Play
@quenty/secrets ✅ Passed (2/2) (984ms) Open | Play
@quenty/settings ✅ Passed (14/14) (1.5s) Open | Play
@quenty/resetservice ✅ Passed (17/17) (1.2s) Open | Play
@quenty/rogue-humanoid ⚠️ Passed (0/0) - ran 0 tests (1.2s) Open | Play
@quenty/friendutils ✅ Passed (13/13) (918ms) Open | Play
@quenty/grouputils ✅ Passed (15/15) (701ms) Open | Play
@quenty/humanoidtracker ✅ Passed (22/22) (984ms) Open | Play
@quenty/playerhumanoidbinder ✅ Passed (25/25) (1.6s) Open | Play
@quenty/marketplaceutils ✅ Passed (20/20) (667ms) Open | Play
@quenty/playerbinder ✅ Passed (8/8) (934ms) Open | Play
@quenty/playersservicepromises ✅ Passed (3/3) (684ms) Open | Play
@quenty/playerthumbnailutils ✅ Passed (4/4) (584ms) Open | Play
@quenty/blend ✅ Passed (3/3) (868ms) Open | Play
@quenty/snackbar ✅ Passed (3/3) (950ms) Open | Play
@quenty/fakeskybox ✅ Passed (3/3) (851ms) Open | Play
@quenty/elo ✅ Passed (5/5) (1.0s) Open | Play
@quenty/genericscreenguiprovider ✅ Passed (8/8) (1.0s) Open | Play
@quenty/observablecollection ✅ Passed (209/209) (1.9s) Open | Play
@quenty/adorneeboundingbox ✅ Passed (49/49) (2.0s) Open | Play
@quenty/rogue-properties ✅ Passed (153/153) (2.3s) Open | Play
@quenty/soundgroup ✅ Passed (8/8) (1.1s) Open | Play
@quenty/lipsum ✅ Passed (4/4) (851ms) Open | Play
@quenty/timedtween ✅ Passed (28/28) (1.6s) Open | Play
@quenty/transitionmodel ✅ Passed (121/121) (3.5s) Open | Play
@quenty/receiptprocessing ✅ Passed (4/4) (834ms) Open | Play
@quenty/remoting ✅ Passed (70/70) (968ms) Open | Play
@quenty/roblox-api-dump ✅ Passed (32/33) (1.2s) Open | Play
@quenty/streamingutils ✅ Passed (6/6) (1.0s) Open | Play
@quenty/teleportserviceutils ✅ Passed (144/144) (6.8s) Open | Play
@quenty/userserviceutils ✅ Passed (6/6) (951ms) Open | Play

52 packages tested, 52 passed, 0 failed in 2m45s
⚠️ 1 package(s) lost their log output — their counts came back in the run's summary, but nothing could be checked for tracebacks
⚠️ 1 package(s) ran 0 tests — check test discovery · View logs

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant