Skip to content

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

@deepak0x

Description

@deepak0x

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions