-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Remove code invalidated by deprecated config flag 'trust_identity_servers_for_password_resets' #11395
Remove code invalidated by deprecated config flag 'trust_identity_servers_for_password_resets' #11395
Changes from 4 commits
9279383
20cbbd9
cb5e336
4360c8f
f32984a
10f31a1
1a70a23
994d80d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Remove code related to deprecated 'trust_identity_servers_for_password_resets' config flag. | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1727,10 +1727,6 @@ def __init__( | |||||
| "refresh_tokens_device_index" | ||||||
| ) | ||||||
|
|
||||||
| self.db_pool.updates.register_background_update_handler( | ||||||
| "user_threepids_grandfather", self._bg_user_threepids_grandfather | ||||||
| ) | ||||||
|
Comment on lines
-1730
to
-1732
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we're happy to remove this update, we should probably make it a no-op so that when a homeserver upgrades from an ancient version to today's, it doesn't fail on this non-existent job. That's because synapse/synapse/storage/schema/main/delta/53/user_threepid_id.sql Lines 28 to 29 in 7ffddd8
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it is pre 1.0.0 it might be OK to just remove?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. given
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Purely out of curiosity: in general, why use no-op background updates vs adding another schema delta to drop an irrelevant background update job?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hrm, that's a great question! I think either solution would be fine. But since we've already got no-ops, there's something to be said for consistency?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a valid point though; I didn't even think about using deletes in schema deltas for removed background jobs (rather than a few cases where we've deleted & re-inserted to prevent duplicates).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great thanks for answering, all! I've changed it to a no-op, I agree that it is hard to argue with consistency. |
||||||
|
|
||||||
| self.db_pool.updates.register_background_update_handler( | ||||||
| "users_set_deactivated_flag", self._background_update_set_deactivated_flag | ||||||
| ) | ||||||
|
|
@@ -1805,35 +1801,6 @@ def _background_update_set_deactivated_flag_txn(txn): | |||||
|
|
||||||
| return nb_processed | ||||||
|
|
||||||
| async def _bg_user_threepids_grandfather(self, progress, batch_size): | ||||||
| """We now track which identity servers a user binds their 3PID to, so | ||||||
| we need to handle the case of existing bindings where we didn't track | ||||||
| this. | ||||||
|
|
||||||
| We do this by grandfathering in existing user threepids assuming that | ||||||
| they used one of the server configured trusted identity servers. | ||||||
| """ | ||||||
| id_servers = set(self.config.registration.trusted_third_party_id_servers) | ||||||
|
|
||||||
| def _bg_user_threepids_grandfather_txn(txn): | ||||||
| sql = """ | ||||||
| INSERT INTO user_threepid_id_server | ||||||
| (user_id, medium, address, id_server) | ||||||
| SELECT user_id, medium, address, ? | ||||||
| FROM user_threepids | ||||||
| """ | ||||||
|
|
||||||
| txn.execute_batch(sql, [(id_server,) for id_server in id_servers]) | ||||||
|
|
||||||
| if id_servers: | ||||||
| await self.db_pool.runInteraction( | ||||||
| "_bg_user_threepids_grandfather", _bg_user_threepids_grandfather_txn | ||||||
| ) | ||||||
|
|
||||||
| await self.db_pool.updates._end_background_update("user_threepids_grandfather") | ||||||
|
|
||||||
| return 1 | ||||||
|
|
||||||
| async def set_user_deactivated_status( | ||||||
| self, user_id: str, deactivated: bool | ||||||
| ) -> None: | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.