Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefix no-unchecked-record-access for presence #23581

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RishhiB
Copy link
Contributor

@RishhiB RishhiB commented Jan 16, 2025

Prefix no-unchecked-record-access for presence

@github-actions github-actions bot added area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct base: main PRs targeted against main branch labels Jan 16, 2025
Comment on lines 400 to 401
let workspaceDatastore = this.datastore[workspaceAddress];
let workspaceDatastore: ValueElementMap<PresenceStatesSchema> | undefined = this.datastore[workspaceAddress];
Copy link
Contributor

Choose a reason for hiding this comment

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

This type of change does not work. We already need to undo all of the similar changes. See comments in other related PRs. Please do not add more.

Comment on lines 120 to +123
mergedData[valueManagerKey] ??= {};
const oldData = mergedData[valueManagerKey][clientSessionId];
mergedData[valueManagerKey][clientSessionId] = mergeValueDirectory(
const oldData = mergedData[valueManagerKey]?.[clientSessionId];
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
mergedData[valueManagerKey]![clientSessionId] = mergeValueDirectory(
Copy link
Contributor

Choose a reason for hiding this comment

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

This is clearly not problematic. Line 120 ensures that mergedData[valueManagerKey] is defined.
So ? is definitely not appropriate.
no-unchecked-record-access is already enabled for this package. Why are there new issues being reported? (If a change in rule pending, did it do better before. The code is correct; so, don't want to see anything flagged here.)

@jason-ha
Copy link
Contributor

The remaining changes to just enable noUncheckedIndexAccess for presence aren't so bad.
#23592

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants