RocketChat / RocketChat/Rocket.Chat.ReactNative
bug: Type safety issue in RoomContext blocking RoomView migration to hooks
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 1.5k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 90
Description
Describe the Bug
There’s a type-safety issue in RoomContext that needs to be fixed.
Right now, the room property is typed as any, which removes TypeScript checks and can lead to hidden bugs.
This also blocks the future migration of RoomView from a class component to hooks.
Steps to Reproduce
Open app/views/RoomView/context.ts
Look at how room is used in components that consume RoomContext
You’ll see there’s no type safety at all
Expected Behavior
The room property should use the correct type, something like:
ISubscription,
TSubscriptionModel,
or a union of both, depending on how RoomView uses it.
This would:
Enable proper TypeScript checking
Allow RoomView to be moved to hooks safely
Prevent type-related crashes at runtime
Actual Behavior
room is currently typed as any
TypeScript can’t catch mistakes
Rocket.Chat Server Version
N/A
Rocket.Chat App Version
4.67.0
Device Name
N/A
OS Version
N/A
Additional Context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open app/views/RoomView/context.ts and inspect how RoomContext's room property is consumed by RoomView and related components. Compare those uses with ISubscription and TSubscriptionModel, then replace any with the type or union that matches them; done means TypeScript checks the consumers without blocking the planned hooks migration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100