Rocket.Chat.ReactNative icon indicating copy to clipboard operation
Rocket.Chat.ReactNative copied to clipboard

bug: Type safety issue in RoomContext blocking RoomView migration to hooks

Open deepak0x opened this issue 2 months ago • 0 comments

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

deepak0x avatar Nov 14 '25 14:11 deepak0x