Skip to content

fix: replace account-data as-any TODOs with explanatory comments (#502)#508

Merged
Just-Insane merged 8 commits into
integrationfrom
fix/issue-502
Jul 2, 2026
Merged

fix: replace account-data as-any TODOs with explanatory comments (#502)#508
Just-Insane merged 8 commits into
integrationfrom
fix/issue-502

Conversation

@Just-Insane

Copy link
Copy Markdown
Collaborator

Root Cause

matrix-js-sdk's setAccountData/getAccountData have typed overloads only for known event types. For arbitrary/developer-tool event types, TypeScript requires a cast. The four TODO comments ("remove once account data typing is unified") referenced a future unification that never happened, providing no guidance to future readers.

Fix

Replaced all four vague TODO comments with structured explanatory comments documenting:

The as never casts themselves remain (they are unavoidable given the current SDK API) but are no longer unexplained tech debt.

Spec

.claude/specs/issue-502.md

Closes #502

Copilot AI review requested due to automatic review settings July 2, 2026 05:50
@Just-Insane Just-Insane enabled auto-merge July 2, 2026 05:51
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Sentry Preview Error Triage

No Sentry errors found for this PR's preview deployment as of Thu, 02 Jul 2026 14:33:47 GMT.

This comment updates automatically after each push.

Copilot AI left a comment

Copy link
Copy Markdown

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 aims to reduce unhelpful tech-debt TODOs by replacing them with explanatory comments that justify unavoidable TypeScript casts around Matrix SDK typing gaps, tying the rationale back to issue #502.

Changes:

  • Replaced vague “remove cast once typing is unified” TODOs with structured explanations in developer-tools account data flows.
  • Updated the RoomCallButton TODO with an explanatory comment (intended to document a cast around SDK typings).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/app/features/settings/developer-tools/DevelopTools.tsx Replaces TODOs with detailed rationale for as never casts when setting/getting arbitrary account-data types.
src/app/features/settings/developer-tools/AccountData.tsx Replaces TODOs with explanatory comments around account-data key listing/refreshing logic.
src/app/features/room/RoomCallButton.tsx Replaces a TODO with an explanatory comment intended to justify event typing casts for an MSC event.

Comment thread src/app/features/settings/developer-tools/AccountData.tsx Outdated
Comment thread src/app/features/settings/developer-tools/AccountData.tsx Outdated
Comment thread src/app/features/room/RoomCallButton.tsx Outdated
@sentry

sentry Bot commented Jul 2, 2026

Copy link
Copy Markdown

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
charm-web-preview
charm-web-preview
0 0 0 0 8 0 ✅ Unchanged

⚙️ sable Snapshot Settings

@github-code-quality

github-code-quality Bot commented Jul 2, 2026

Copy link
Copy Markdown

Code Coverage Overview

Languages: JavaScript

JavaScript / code-coverage/vitest

The overall coverage remains at 30%, unchanged from the branch.


Updated July 02, 2026 14:37 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

Apply prettier formatting (double quotes, trailing commas, parameter wrapping)
Apply prettier formatting (double quotes, trailing commas)
@sentry

sentry Bot commented Jul 2, 2026

Copy link
Copy Markdown

🚧 Skipped: PR exceeds review size limit.

Please split into smaller PRs and re-run.
Reference ID: 1512331

Comment thread src/app/components/message/Reply.tsx Fixed
Comment thread src/app/components/url-preview/ClientPreview.tsx Fixed
Comment thread src/app/components/user-profile/UserRoomProfile.tsx Fixed
Comment thread src/app/hooks/useCommands.ts Fixed
Comment thread src/app/pages/client/space/Space.tsx Outdated
}
>
<PageNavHeader outlined={!hasBanner} size="600">
{hideText ? (
<Box alignItems="Center" grow="Yes" justifyContent="Center">
<Avatar size={hideText ? undefined : '200'} radii="400" onClick={handleOpenMenu}>
<Avatar
size={hideText ? undefined : "200"}
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

OpenTofu plan for production

Plan: 3 to add, 0 to change, 3 to destroy.
OpenTofu used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement

OpenTofu will perform the following actions:

  # cloudflare_worker_version.site must be replaced
-/+ resource "cloudflare_worker_version" "site" {
!~      annotations         = {
+           workers_message      = (known after apply)
+           workers_tag          = (known after apply)
!~          workers_triggered_by = "create_version_api" -> (known after apply)
        } -> (known after apply)
!~      assets              = { # forces replacement
!~          asset_manifest_sha256 = "cfb29faf79c62cc3ab25e96e1f8c626997964acf0104c8d1c40e1161c4b80710" -> "31cd6d61e277370fbda342f933c7764947bfc78f22b649f9d88ff34fd8b2c3bf" # forces replacement
!~          directory             = "/home/runner/work/Charm/Charm/dist/client" -> "/github/workspace/dist/client"
#            (1 unchanged attribute hidden)
        }
+       compatibility_flags = (known after apply)
!~      created_on          = "2026-06-23T18:49:50Z" -> (known after apply)
!~      id                  = "************************************" -> (known after apply)
+       limits              = (known after apply)
+       main_script_base64  = (known after apply)
!~      modules             = [
-           {
-               content_file   = "/home/runner/work/Charm/Charm/dist/charm/index.js" -> null
-               content_sha256 = "ba9b71550741749400afaa0bbd6f38b92f9607890c4f2b3265e68241823277b9" -> null
-               content_type   = "application/javascript+module" -> null
-               name           = "index.js" -> null
            },
+           {
+               content_file   = "/github/workspace/dist/charm/index.js"
+               content_sha256 = "ba9b71550741749400afaa0bbd6f38b92f9607890c4f2b3265e68241823277b9"
+               content_type   = "application/javascript+module"
+               name           = "index.js"
            },
        ]
!~      number              = 1 -> (known after apply)
!~      source              = "terraform" -> (known after apply)
!~      startup_time_ms     = 0 -> (known after apply)
#        (5 unchanged attributes hidden)
    }

  # cloudflare_workers_custom_domain.site must be replaced
-/+ resource "cloudflare_workers_custom_domain" "site" {
-       environment = "production" -> null # forces replacement
!~      id          = "****************************************" -> (known after apply)
!~      zone_name   = "cloudhub.social" -> (known after apply)
#        (4 unchanged attributes hidden)
    }

  # cloudflare_workers_deployment.site must be replaced
-/+ resource "cloudflare_workers_deployment" "site" {
!~      annotations  = { # forces replacement
!~          workers_message      = "integration" -> "fix: replace account-data as-any TODOs with explanatory comments (#502)"
!~          workers_triggered_by = "deployment" -> (known after apply)
        }
+       author_email = (known after apply)
!~      created_on   = "2026-06-23T18:49:50Z" -> (known after apply)
!~      id           = "************************************" -> (known after apply)
!~      source       = "terraform" -> (known after apply)
!~      versions     = [ # forces replacement
!~          {
!~              version_id = "************************************" -> (known after apply)
#                (1 unchanged attribute hidden)
            },
        ]
#        (3 unchanged attributes hidden)
    }

Plan: 3 to add, 0 to change, 3 to destroy.

📝 Plan generated in Cloudflare Infra #230

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

Status Preview URL Commit Alias Updated (UTC)
✅ Deployment successful! https://pr-508-charm.justin-tech.workers.dev 222ea74 pr-508 Thu, 02 Jul 2026 14:35:46 GMT

@Just-Insane Just-Insane merged commit eea746b into integration Jul 2, 2026
36 of 38 checks passed
@Just-Insane Just-Insane deleted the fix/issue-502 branch July 2, 2026 14:37
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.

[Tech Debt] Account-data typing is unified in name only (scattered as any casts)

3 participants