Skip to content

Add module apis for watching for deviceId - #35741

Merged
Half-Shot merged 3 commits into
developfrom
hs/module-api-client-extras
Nov 9, 2026
Merged

Half-Shot merged 3 commits into
developfrom
hs/module-api-client-extras

Conversation

@Half-Shot

@Half-Shot Half-Shot commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

3 common things we do in modules that probably should just get their own API. Unsure whether we should slap some warnings on these that they may break when multi-account comes in?

Removed the access token because it was controversial . Given the userId is already exposed as a watchable under Profile, I've cheekily included deviceId too rather than adding it under it's own thing.

Checklist

  • I have read through review guidelines and CONTRIBUTING.md.
  • I have linked the PR to an issue that describes what needs changing.
  • I have written tests for new code (and old code if feasible).
  • I have ensured new or updated public/exported symbols have accurate TSDoc documentation.
  • I have confirmed linter and other CI checks pass.
  • I have have included screenshots if what the user sees will change
  • I have licensed the changes to Element by completing the Contributor License Agreement (CLA)
  • I will no longer force push to this branch

AI assistance

  • I used AI tools to help create this PR.

@t3chguy t3chguy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is a bad idea. Token TTL default in MAS is 5 minutes. Which makes it rather likely that a token you read ends up expiring rather soon and you have to handle refresh. Your proposed API returns strings, not Watchables, and making all Modules respect token refresh would be spurious additional work which could be done on this side of the fence with a better API.

Moving to a separate PR as doAuthenticatedRequest.
@Half-Shot Half-Shot changed the title Add module apis for getting user/device/access token. Add module apis for watching for deviceId Nov 9, 2026
@Half-Shot
Half-Shot requested a review from t3chguy November 9, 2026 12:53
@Half-Shot Half-Shot added the T-Feature Request to add a new feature which does not exist right now label Nov 9, 2026
@Half-Shot Half-Shot added T-Enhancement and removed T-Feature Request to add a new feature which does not exist right now labels Nov 9, 2026
@Half-Shot
Half-Shot added this pull request to the merge queue Nov 9, 2026
Merged via the queue into develop with commit 4e9efb0 Nov 9, 2026
80 of 84 checks passed
@Half-Shot
Half-Shot deleted the hs/module-api-client-extras branch November 9, 2026 15:27

This branch was successfully deployed

3 active deployments
EndToEndTests — 002df8ea Deployed Nov 9, 2026 by github-actions[bot]
SharedComponentStorybook — 002df8ea Deployed Nov 9, 2026 by github-actions[bot]
Netlify — 002df8ea Deployed Nov 9, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants