-
Notifications
You must be signed in to change notification settings - Fork 13k
feat(apps): graduate getUserRoomIds experiment to the user bridge #37547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
fbfca82
Graduate getUserRoomIds to user bridge
Dnouv ece633a
Update Meteor user bridge room access
Dnouv b7379d7
Reuse existing user read permission
Dnouv ac72cca
Fix experimental accessor build
Dnouv 2eb6ed8
Add changeset
Dnouv 369e53e
Fix missing newline at end of file in en.i18n.json
Dnouv 36dc469
Fix lint warnings
Dnouv b2106d8
Make experimental read interface non-empty
Dnouv 4f8f518
AppExperimentalBridge remove dependency on orchestrator
Dnouv 8187c2a
Merge branch 'develop' into new/ae/graduate_uroomid
Dnouv 8c81ca3
Merge branch 'develop' into new/ae/graduate_uroomid
Dnouv cc26c93
Restore experimental bridge wiring
Dnouv 4e6bd51
Ensure context is maintained in ExperimentalRead constructor
Dnouv 036e677
AppExperimentalBridge to ensure context is maintained in constructor
Dnouv bd241fe
Relax experimental bridge visibility
Dnouv 7441191
Update .changeset/calm-falcons-gather.md
d-gubert 45a749e
Address review feedback
Dnouv fb159e3
Merge branch 'develop' into new/ae/graduate_uroomid
d-gubert 17a00bc
Merge branch 'develop' into new/ae/graduate_uroomid
d-gubert da87b79
Merge branch 'develop' into new/ae/graduate_uroomid
kodiakhq[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@rocket.chat/apps-engine": minor | ||
| "@rocket.chat/meteor": minor | ||
| --- | ||
|
|
||
| Adds the `getUserRoomIds` method to the `UserRead` accessor in the Apps-Engine, graduating it from the experimental bridge to the stable user bridge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,8 @@ | ||
| import type { IAppServerOrchestrator } from '@rocket.chat/apps'; | ||
| import { ExperimentalBridge } from '@rocket.chat/apps-engine/server/bridges'; | ||
| import { Subscriptions } from '@rocket.chat/models'; | ||
|
|
||
| import { metrics } from '../../../metrics/server/lib/metrics'; | ||
|
|
||
| export class AppExperimentalBridge extends ExperimentalBridge { | ||
| constructor(private readonly orch: IAppServerOrchestrator) { | ||
| constructor(protected readonly orch: IAppServerOrchestrator) { | ||
| super(); | ||
| } | ||
|
|
||
| protected async getUserRoomIds(userId: string, appId: string): Promise<string[] | undefined> { | ||
| const stopTimer = metrics.appBridgeMethods.startTimer({ | ||
| bridge: 'experimental', | ||
| method: 'getUserRoomIds', | ||
| app_id: appId, | ||
| }); | ||
|
|
||
| try { | ||
| this.orch.debugLog(`The App ${appId} is getting the room ids for the user: "${userId}"`); | ||
|
|
||
| const subscriptions = await Subscriptions.findByUserId(userId, { projection: { rid: 1 } }).toArray(); | ||
|
|
||
| const result = subscriptions.map((subscription) => subscription.rid); | ||
|
|
||
| return result; | ||
| } finally { | ||
| stopTimer(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 1 addition & 5 deletions
6
packages/apps-engine/tests/test-data/bridges/experimentalBridge.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,3 @@ | ||
| import { ExperimentalBridge } from '../../../src/server/bridges'; | ||
|
|
||
| export class TestExperimentalBridge extends ExperimentalBridge { | ||
| protected getUserRoomIds(userId: string, appId: string): Promise<string[] | undefined> { | ||
| throw new Error('Method not implemented.'); | ||
| } | ||
| } | ||
| export class TestExperimentalBridge extends ExperimentalBridge {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.