Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Allow upgrading a room only once #5045

Closed
wants to merge 2 commits into from

Conversation

anoadragon453
Copy link
Member

Prevents a room from being upgraded more than once, and also prevents a room upgrade for a room if one is currently ongoing. Returns a 400 with the message "This room has already been upgraded" in either case.

Fixes #4583

@anoadragon453 anoadragon453 requested a review from a team April 11, 2019 11:09
@codecov
Copy link

codecov bot commented Apr 11, 2019

Codecov Report

Merging #5045 into develop will decrease coverage by 0.01%.
The diff coverage is 10%.

@@             Coverage Diff             @@
##           develop    #5045      +/-   ##
===========================================
- Coverage    61.57%   61.55%   -0.02%     
===========================================
  Files          332      332              
  Lines        34265    34275      +10     
  Branches      5648     5650       +2     
===========================================
+ Hits         21097    21098       +1     
- Misses       11654    11660       +6     
- Partials      1514     1517       +3

@anoadragon453 anoadragon453 removed the request for review from a team April 12, 2019 10:32
@babolivier babolivier requested a review from a team April 17, 2019 11:18
defer.returnValue(None)

# Retrieve the room's tombstone event and return
tombstone_event = yield self.get_event(tombstone_id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will raise an exception if the event has been redacted. We probably want to allow an upgrade if the tombstone is redacted? idk

@anoadragon453
Copy link
Member Author

Superseded by #5051 due to discussion in #4583 (comment).

@anoadragon453 anoadragon453 deleted the anoa/upgrade_room_only_once branch May 23, 2019 12:33
anoadragon453 added a commit that referenced this pull request Jun 25, 2019
Closes #4583

Does slightly less than #5045, which prevented a room from being upgraded multiple times, one after another. This PR still allows that, but just prevents two from happening at the same time.

Mostly just to mitigate the fact that servers are slow and it can take a moment for the room upgrade to actually complete. We don't want people sending another request to upgrade the room when really they just thought the first didn't go through.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants