Skip to content
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

[FIX] Not allowed error in discussion room with a private parent channel #26394

Merged
merged 6 commits into from
Aug 23, 2022

Conversation

filipemarins
Copy link
Contributor

@filipemarins filipemarins commented Jul 28, 2022

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

If a user is added to a discussion that was created under a private group as its parent channel and that user does not have access to the parent private group, the user keeps getting a "not-allowed" error banner whenever they open the discussion.
Sometimes the error too-many-request is thrown (429).

The ParentRoomWithEndpointData component was calling the rooms.info as a fallback when the parent component didn't have the Subscription. This fallback was fine before when the room component wasn't await for Subscription. Nowadays this fallback doesn't make sense because the room already waits for Subscription to load, the current fallback is only being used when the user doesn't have permission to view the info in the parent room.

@filipemarins filipemarins requested a review from a team as a code owner July 28, 2022 17:23
@codecov
Copy link

codecov bot commented Jul 28, 2022

Codecov Report

Merging #26394 (76e9b25) into develop (f0ad004) will increase coverage by 0.00%.
The diff coverage is 16.66%.

❗ Current head 76e9b25 differs from pull request most recent head f2968cc. Consider uploading reports for the commit f2968cc to get more accurate results

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #26394   +/-   ##
========================================
  Coverage    37.97%   37.98%           
========================================
  Files          778      779    +1     
  Lines        18854    18860    +6     
  Branches      1932     1933    +1     
========================================
+ Hits          7160     7164    +4     
- Misses       11400    11403    +3     
+ Partials       294      293    -1     
Flag Coverage Δ
e2e 37.98% <16.66%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@gabriellsh
Copy link
Member

the current fallback is only being used when the user doesn't have permission to view the info in the parent room.

Actually, if the parent room is a public channel, the user does have permission to fetch the info through the endpoint. We should only change the fetch to not dispatch an error message.

gabriellsh
gabriellsh previously approved these changes Aug 22, 2022
…/room

* 'fix/room' of github.com:RocketChat/Rocket.Chat:
  Chore: Create teams management tests (#26578)
@ggazzo ggazzo added stat: ready to merge PR tested and approved waiting for merge and removed stat: needs QA labels Aug 23, 2022
@gabriellsh gabriellsh added this to the 5.1.0 milestone Aug 23, 2022
@ggazzo ggazzo merged commit 00c787f into develop Aug 23, 2022
@ggazzo ggazzo deleted the fix/room branch August 23, 2022 17:36
gabriellsh added a commit that referenced this pull request Aug 24, 2022
…ove/otr-message

* 'develop' of github.com:RocketChat/Rocket.Chat:
  Regression: Add alsoSendThreadToChannel to user settings api (#26663)
  [IMPROVE] Spotlight search user results (#26599)
  [FIX] Slack User CSV importer not working (#26629)
  Chore: Importer rest types, meteor methods to TS and API unit tests (#26284)
  [NEW] Adding oauth crud on the rocket.chat side (#26220)
  [NEW] allow ephemeral messages to receive a specific id (#26118)
  [FIX] MDM content alignment (#26665)
  Chore: Permissions check per endpoint/method (#26419)
  Regression: CI (#26658)
  [FIX] Not allowed error in discussion room with a private parent channel (#26394)
  Chore: Fix grammatical typo when only one message is pruned (#21902)
  [FIX] Agents (with user status offline & omni-status as available) not able to take or forward chat (#26575)
  i18n: Language update from LingoHub 🤖 on 2022-08-22Z (#26645)
  Chore: Add license env var to ee tests (#26650)
  Chore: Move `Card` and related components to `@rocket.chat/ui-client` (#26653)
  Regression: Custom status loading forever in Usercard (#26656)
  [FIX] Current Chat Custom Field Filter (#26200)
  Chore: Migrate modules related to `room` template to TypeScript (#25881)
  Chore: Create teams management tests (#26578)
@murtaza98 murtaza98 mentioned this pull request Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat: ready to merge PR tested and approved waiting for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants