summary refs log tree commit diff
path: root/synapse/storage (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/develop' into ↵David Baker2016-10-141-0/+3
|\ | | | | | | dbkr/password_reset_case_insensitive
| * Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2016-10-113-44/+64
| |\ | | | | | | | | | erikj/replication_noop
| * | Reduce DB hits for replicationErik Johnston2016-09-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some streams will occaisonally advance their positions without actually having any new rows to send over federation. Currently this means that the token will not advance on the workers, leading to them repeatedly sending a slightly out of date token. This in turns requires the master to hit the DB to check if there are any new rows, rather than hitting the no op logic where we check if the given token matches the current token. This commit changes the API to always return an entry if the position for a stream has changed, allowing workers to advance their tokens correctly.
* | | Make password reset email field case insensitiveDavid Baker2016-10-142-10/+36
| |/ |/|
* | storage/appservice: make appservice methods only relying on the cache ↵Patrik Oldsberg2016-10-061-6/+6
| | | | | | | | synchronous
* | Merge pull request #1145 from matrix-org/erikj/fix_reindexErik Johnston2016-09-291-15/+29
|\ \ | | | | | | Fix background reindex of origin_server_ts
| * | Fix background reindex of origin_server_tsErik Johnston2016-09-271-15/+29
| |/ | | | | | | | | | | | | | | The storage function `_get_events_txn` was removed everywhere except from this background reindex. The function was removed due to it being (almost) completely unused while also being large and complex. Therefore, instead of resurrecting `_get_events_txn` we manually reimplement the bits that are needed directly.
* | Remove duplicationErik Johnston2016-09-271-31/+19
| |
* | Remove unused variableErik Johnston2016-09-271-3/+0
| |
* | Fix perf of fetching state in SQLiteErik Johnston2016-09-261-20/+41
|/
* Match against event_id, rather than room_idErik Johnston2016-09-211-1/+1
|
* Remove spurious AS clauseErik Johnston2016-09-211-1/+1
|
* Update correct tableErik Johnston2016-09-211-6/+10
|
* Readd entries to public_room_list_stream that were deletedErik Johnston2016-09-212-1/+23
|
* Fix _delete_old_forward_extrem_cache queryErik Johnston2016-09-211-5/+4
|
* CommentErik Johnston2016-09-161-0/+2
|
* Filter remote rooms lists locallyErik Johnston2016-09-161-1/+1
|
* Handling expiring stream extrems correctly.Erik Johnston2016-09-152-3/+22
|
* Change get_pos_of_last_change to return upper boundErik Johnston2016-09-151-3/+2
|
* Use stream_change cache to make get_forward_extremeties_for_room cache more ↵Erik Johnston2016-09-151-1/+10
| | | | effective
* Add cache to get_forward_extremeties_for_roomErik Johnston2016-09-151-0/+1
|
* Merge pull request #1121 from matrix-org/erikj/public_room_paginateErik Johnston2016-09-156-15/+288
|\ | | | | Add pagination support to publicRooms
| * Stream public room changes down replicationErik Johnston2016-09-151-0/+16
| |
| * Base public room list off of public_rooms streamErik Johnston2016-09-151-0/+52
| |
| * Calculate the public room list from a stream_orderingErik Johnston2016-09-141-0/+3
| |
| * Add a room visibility streamErik Johnston2016-09-144-16/+100
| |
| * Add a DB index to figure out past state at a stream ordering in a roomErik Johnston2016-09-142-0/+118
| |
* | Fix reindexErik Johnston2016-09-141-15/+16
| |
* | Ensure we don't mutate state cache entriesErik Johnston2016-09-141-20/+25
|/
* Remove where clauseErik Johnston2016-09-121-1/+0
|
* Index contains_url for file search queriesErik Johnston2016-09-122-0/+25
|
* Add WHERE clause support to index creationErik Johnston2016-09-122-10/+17
|
* Merge pull request #1106 from matrix-org/erikj/state_reindex_concurrentErik Johnston2016-09-121-1/+1
|\ | | | | Create new index concurrently
| * Create new index concurrentlyErik Johnston2016-09-121-1/+1
| |
* | Merge pull request #1105 from matrix-org/erikj/make_notif_highlight_query_fastErik Johnston2016-09-122-1/+29
|\ \ | |/ |/| Optimise /notifications query
| * Change the index to be stream_ordering, highlightErik Johnston2016-09-121-1/+1
| |
| * Remove unused importErik Johnston2016-09-121-1/+0
| |
| * Use register_background_index_updateErik Johnston2016-09-121-24/+4
| |
| * Add back in query changeErik Johnston2016-09-121-1/+3
| |
| * Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2016-09-128-22/+60
| |\ | | | | | | | | | erikj/make_notif_highlight_query_fast
| * | Make reindex happen in bgErik Johnston2016-09-122-3/+32
| | |
* | | Merge pull request #1104 from matrix-org/markjh/direct_to_device_federation_syncMark Haines2016-09-121-0/+2
|\ \ \ | |_|/ |/| | Fix direct to device messages recieved over federation to notify sync
| * | Fix direct to device messages recieved over federation to notify syncMark Haines2016-09-121-0/+2
| | |
* | | Add comments to existing schema deltas that used "CREATE INDEX" directlyMark Haines2016-09-126-0/+24
|/ /
* | Revert "Add index to event_push_actions"Erik Johnston2016-09-122-21/+1
| |
* | Change state fetch query for postgres to be fasterErik Johnston2016-09-121-19/+35
|/ | | | | | It turns out that postgres doesn't like doing a list of OR's and is about 1000x slower, so we just issue a query for each specific type seperately.
* Merge remote-tracking branch 'origin/develop' into ↵David Baker2016-09-099-40/+360
|\ | | | | | | dbkr/make_notif_highlight_query_fast
| * Use the previous MAX value if any to set the stream_idMark Haines2016-09-091-1/+2
| |
| * Track the max_stream_device_id in a separate table, since we delete from the ↵Mark Haines2016-09-093-3/+36
| | | | | | | | inbox table
| * Merge pull request #1087 from matrix-org/markjh/reapply_deltaMark Haines2016-09-091-1/+4
| |\ | | | | | | Reapply 34/device_outbox in 35/device_outbox_again.py since the schem…
| | * Just move the schema and add some DROPsMark Haines2016-09-092-35/+4
| | |
| | * Only catch databas errorsMark Haines2016-09-081-1/+1
| | |
| | * Add a stub run_upgradeMark Haines2016-09-081-0/+4
| | |
| | * Reapply 34/device_outbox in 35/device_outbox_again.py since the schema was ↵Mark Haines2016-09-081-0/+30
| | | | | | | | | | | | bumped before it landed on develop
| * | Merge branch 'release-v0.17.3' of github.com:matrix-org/synapse into developErik Johnston2016-09-091-1/+1
| |\ \
| | * | Reduce batch size to be under SQL limitErik Johnston2016-09-091-1/+1
| | | |
| * | | Merge pull request #1081 from matrix-org/dbkr/notifications_only_highlightMatthew Hodgson2016-09-091-1/+8
| |\ \ \ | | | | | | | | | | Implement `only=highlight` on `/notifications`
| * \ \ \ Merge pull request #1080 from matrix-org/dbkr/fix_notifications_api_with_fromDavid Baker2016-09-081-1/+1
| |\ \ \ \ | | | | | | | | | | | | Fix /notifications API when used with `from` param
| | * | | | Fix /notifications API when used with `from` paramDavid Baker2016-09-081-1/+1
| | | | | |
| * | | | | Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2016-09-081-18/+36
| |\ \ \ \ \ | | | |_|_|/ | | |/| | | | | | | | | erikj/reindex_state_groups
| | * | | | Support wildcard device_ids for direct to device messagesMark Haines2016-09-081-18/+36
| | | | | |
| * | | | | Add delta fileErik Johnston2016-09-081-0/+20
| | | | | |
| * | | | | Reindex state_groups_state after pruningErik Johnston2016-09-082-2/+37
| |/ / / /
| * | | | Merge branch 'develop' into markjh/direct_to_device_federationMark Haines2016-09-086-75/+444
| |\ \ \ \
| * | | | | Fix the stream change cache to work over replicationMark Haines2016-09-071-1/+1
| | | | | |
| * | | | | Add stream change caches for device messagesMark Haines2016-09-072-0/+49
| | | | | |
| * | | | | Comment the add_messages storage functionsMark Haines2016-09-071-8/+16
| | | | | |
| * | | | | Send device messages over federationMark Haines2016-09-062-14/+9
| | | | | |
| * | | | | Add storage methods for federated device messagesMark Haines2016-09-061-7/+132
| | | | | |
| * | | | | Add tables for federated device messagesMark Haines2016-09-061-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds tables for storing the messages that need to be sent to a remote device and for deduplicating messages received.
| * | | | | Move _add_messages_to_device_inbox_txn into a separate methodMark Haines2016-09-061-37/+32
| | |_|_|/ | |/| | |
* | | | | Add index to event_push_actionsDavid Baker2016-09-092-1/+21
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | and remove room_id caluse so it uses it Mostly from @negativemjark
* | | | Implement `only=highlight` on `/notifications`David Baker2016-09-081-1/+8
| |/ / |/| |
* | | Log delta files we're applyingErik Johnston2016-09-081-2/+2
| | |
* | | Temporarily disable sequential scans for state fetchingErik Johnston2016-09-081-0/+4
| |/ |/|
* | Merge pull request #1077 from matrix-org/markjh/device_loggingMark Haines2016-09-071-2/+6
|\ \ | | | | | | Log the types and values when failing to store devices
| * | Log the types and values when failing to store devicesMark Haines2016-09-071-2/+6
| |/
* | CommentErik Johnston2016-09-071-0/+4
| |
* | Add appopriate framing clauseErik Johnston2016-09-071-0/+1
| |
* | Use windowing function to make use of indexErik Johnston2016-09-071-5/+5
| |
* | Scale the batch size so that we're not bitten by the minimumErik Johnston2016-09-051-1/+5
| |
* | Correctly handle reindexing state groups that already have an edgeErik Johnston2016-09-051-0/+19
| |
* | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/state_storageErik Johnston2016-09-051-13/+9
|\|
| * Remove unused importsErik Johnston2016-09-051-1/+0
| |
| * Only fetch local pushersErik Johnston2016-09-051-1/+3
| |
| * Make bulk_get_push_rules_for_room use get_joined_users_from_context cacheErik Johnston2016-09-051-12/+7
| |
* | Take value in a better wayErik Johnston2016-09-052-3/+3
| |
* | Comment about sqlite and WITH RECURSIVEErik Johnston2016-09-051-0/+4
| |
* | Correctly delete old state groups in purge history APIErik Johnston2016-09-052-20/+80
| |
* | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/state_storageErik Johnston2016-09-051-3/+5
|\|
| * Merge pull request #1066 from matrix-org/markjh/direct_to_device_lowerboundMark Haines2016-09-021-3/+5
| |\ | | | | | | Only return new device messages in /sync
| | * Only return new device messages in /syncMark Haines2016-09-021-3/+5
| | |
* | | Add commentsErik Johnston2016-09-051-41/+38
| | |
* | | Add upgrade script that will slowly prune state_groups_state entriesErik Johnston2016-09-052-75/+220
| | |
* | | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/state_storageErik Johnston2016-09-021-1/+1
|\| |
| * | Bump max_entries on get_destination_retry_timingsErik Johnston2016-09-021-1/+1
| |/
* | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/state_storageErik Johnston2016-09-024-2/+78
|\|
| * Merge pull request #1060 from matrix-org/erikj/state_idsErik Johnston2016-09-014-62/+72
| |\ | | | | | | Assign state groups in state handler.
| * | Lower get_linearized_receipts_for_room cache sizeErik Johnston2016-08-311-1/+1
| | |
| * | Merge pull request #1059 from matrix-org/erikj/sent_transaction_deleteErik Johnston2016-08-312-0/+34
| |\ \ | | | | | | | | Clean up old sent transactions
| | * | Clean up old sent transactionsErik Johnston2016-08-312-0/+34
| | | |
| * | | Return the current stream position from add_messages_to_device_inboxMark Haines2016-08-311-1/+4
| | | |
| * | | Add a replication stream for direct to device messagesMark Haines2016-08-311-0/+39
| |/ /
* | | Limit the length of state chainsErik Johnston2016-09-022-43/+106
| | |
* | | Move to storing state_groups_state as deltasErik Johnston2016-09-013-60/+124
| |/ |/|
* | Use state_groups table to test existenceErik Johnston2016-08-311-1/+1
| |
* | Correctly handle the difference between prev and current stateErik Johnston2016-08-312-7/+23
| |
* | Generate state group ids in state layerErik Johnston2016-08-312-16/+18
| |
* | Make _state_groups_id_gen a normal IdGeneratorErik Johnston2016-08-303-48/+40
|/
* Merge pull request #1049 from matrix-org/erikj/presence_users_in_roomErik Johnston2016-08-302-10/+2
|\ | | | | Use state handler instead of get_users_in_room/get_joined_hosts
| * Use state handler instead of get_users_in_room/get_joined_hostsErik Johnston2016-08-262-10/+2
| |
* | Merge remote-tracking branch 'origin/develop' into markjh/direct_to_deviceMark Haines2016-08-263-32/+173
|\|
| * Add is_host_joined to slave storageErik Johnston2016-08-261-3/+4
| |
| * Cache check_host_in_roomErik Johnston2016-08-261-0/+35
| |
| * Make sync not pull out full stateErik Johnston2016-08-251-0/+33
| |
| * Add descErik Johnston2016-08-251-1/+2
| |
| * Replace context.current_state with context.current_state_idsErik Johnston2016-08-253-16/+66
| |
| * Pull out event ids rather than full events for stateErik Johnston2016-08-251-17/+38
| |
* | Merge branch 'develop' into markjh/direct_to_deviceMark Haines2016-08-252-9/+13
|\|
| * Preserve some logcontextsErik Johnston2016-08-242-9/+13
| |
* | Fix the deduplication of incoming direct-to-device messagesMark Haines2016-08-251-0/+4
| |
* | Add store-and-forward direct-to-device messagingMark Haines2016-08-253-0/+165
|/
* Merge pull request #1038 from matrix-org/erikj/receved_txn_purgeErik Johnston2016-08-232-4/+45
|\ | | | | Delete old received_transactions rows
| * Delete old received_transactionsErik Johnston2016-08-222-4/+45
| |
* | Merge pull request #1028 from matrix-org/dbkr/notifications_apiErik Johnston2016-08-222-0/+55
|\ \ | |/ |/| Add the Notifications API
| * Merge branch 'develop' into dbkr/notifications_apiMatthew Hodgson2016-08-208-11/+70
| |\
| * | Explicit joinDavid Baker2016-08-181-2/+2
| | |
| * | Merge remote-tracking branch 'origin/develop' into dbkr/notifications_apiDavid Baker2016-08-1812-164/+382
| |\ \
| * \ \ Merge remote-tracking branch 'origin/develop' into dbkr/notifications_apiDavid Baker2016-08-1138-657/+1984
| |\ \ \
| * | | | Include the ts the notif was received atDavid Baker2016-05-241-5/+7
| | | | |
| * | | | Add GET /notifications APIDavid Baker2016-05-232-0/+53
| | | | |
* | | | | Merge pull request #1031 from matrix-org/erikj/measure_notifierErik Johnston2016-08-221-40/+42
|\ \ \ \ \ | |_|_|_|/ |/| | | | Add more Measure blocks
| * | | | Move defer.returnValue out of MeasureErik Johnston2016-08-191-1/+1
| | | | |
| * | | | Measure _get_event_from_rowErik Johnston2016-08-191-41/+43
| | | | |
* | | | | Merge pull request #1030 from matrix-org/erikj/cache_contextsErik Johnston2016-08-197-9/+65
|\ \ \ \ \ | |/ / / / |/| | | | Add concept of cache contexts
| * | | | Rename to on_invalidateErik Johnston2016-08-191-3/+3
| | | | |
| * | | | Make cache_context an explicit optionErik Johnston2016-08-191-1/+1
| | | | |
| * | | | Move _bulk_get_push_rules_for_room to storage layerErik Johnston2016-08-191-0/+56
| | | | |
| * | | | Remove lru optionErik Johnston2016-08-197-9/+9
| | |_|/ | |/| |
* / | | Make get_new_events_for_appservice use indicesErik Johnston2016-08-191-2/+5
|/ / /
* | | Add appservice workerErik Johnston2016-08-182-85/+93
| | |
* | | Make AppserviceHandler stream events from databaseErik Johnston2016-08-182-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is for two reasons: 1. Suppresses duplicates correctly, as the notifier doesn't do any duplicate suppression. 2. Makes it easier to connect the AppserviceHandler to the replication stream.
* | | Fix push_display_name_rename schema updateErik Johnston2016-08-171-0/+3
| | |
* | | Merge pull request #1011 from matrix-org/dbkr/contains_display_name_overrideDavid Baker2016-08-171-0/+17
|\ \ \ | | | | | | | | Move display name rule
| * | | Add migration scriptDavid Baker2016-08-161-0/+17
| | | | | | | | | | | | | | | | To port existing rule actions & enable entries to the new name
* | | | Do it in storage functionErik Johnston2016-08-161-0/+3
|/ / /
* | | Merge pull request #1010 from matrix-org/erikj/refactor_deletionsErik Johnston2016-08-162-38/+33
|\ \ \ | | | | | | | | Refactor user_delete_access_tokens. Invalidate get_user_by_access_token to slaves.
| * | | Use cached get_user_by_access_token in slavesErik Johnston2016-08-161-0/+1
| | | |
| * | | Refactor user_delete_access_tokens. Invalidate get_user_by_access_token to ↵Erik Johnston2016-08-151-38/+32
| | | | | | | | | | | | | | | | slaves.
* | | | Merge branch 'fix_integrity_retry' of https://github.com/Ralith/synapse into ↵Erik Johnston2016-08-161-1/+2
|\ \ \ \ | |/ / / |/| | | | | | | Ralith-fix_integrity_retry
| * | | Add missing database corruption recovery caseBenjamin Saunders2016-08-141-1/+2
| | |/ | |/| | | | | | | Signed-off-by: Benjamin Saunders <ben.e.saunders@gmail.com>
* | | Doc get_next() context manager usageErik Johnston2016-08-151-0/+4
| | |
* | | Rename table. Add docs.Erik Johnston2016-08-153-5/+15
| | |
* | | Implement cache replication streamErik Johnston2016-08-152-15/+43
| | |
* | | Add some invalidations to a cache_streamErik Johnston2016-08-157-31/+117
| | |
* | | Always run txn.after_callbacksErik Johnston2016-08-151-7/+8
|/ /
* | Raise 404 when couldn't find eventErik Johnston2016-08-051-1/+1
| |
* | Delete more tablesErik Johnston2016-08-051-0/+5
| |
* | Tweak integrity error recovery to work as intendedBenjamin Saunders2016-08-041-0/+3
| |
* | Fix typoErik Johnston2016-08-041-3/+4
| |
* | Retry event persistence on IntegrityErrorErik Johnston2016-08-041-4/+65
| | | | | | | | | | | | | | | | | | | | Due to a bug in the porting script some backfilled events were not correctly persisted, causing irrecoverable IntegrityErrors on future attempts to persist those events. This commit adds a retry mechanism invoked upon IntegrityError, where when retried the tables are purged for all references to the events being persisted.
* | PEP8Richard van der Hoff2016-08-031-10/+10
| |
* | Include device name in /keys/query responseRichard van der Hoff2016-08-031-17/+43
| | | | | | | | Add an 'unsigned' section which includes the device display name.
* | Merge branch 'rav/null_default_device_displayname' into developRichard van der Hoff2016-08-032-1/+21
|\ \
| * | Default device_display_name to nullRichard van der Hoff2016-08-032-1/+21
| | | | | | | | | | | | | | | | | | It turns out that it's more useful to return a null device display name (and let clients decide how to handle it: eg, falling back to device_id) than using a constant string like "unknown device".
* | | Remove other bit of deduplicationErik Johnston2016-08-031-19/+0
| | |
* | | Ensure we only persist an event once at a timeErik Johnston2016-08-031-1/+18
|/ /
* | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/fed_readerErik Johnston2016-07-2912-120/+552
|\ \
| * | Fix SQL to supply arguments in the same orderMark Haines2016-07-291-1/+1
| | |
| * | Create separate methods for getting messages to pushMark Haines2016-07-281-45/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for the email and http pushers rather than trying to make a single method that will work with their conflicting requirements. The http pusher needs to get the messages in ascending stream order, and doesn't want to miss a message. The email pusher needs to get the messages in descending timestamp order, and doesn't mind if it misses messages.
| * | Comment get_unread_push_actions_for_user_in_range functionKegan Dougal2016-07-281-2/+26
| | |
| * | Merge pull request #956 from matrix-org/rav/check_device_id_on_key_uploadRichard van der Hoff2016-07-272-0/+34
| |\ \ | | | | | | | | Make the device id on e2e key upload optional
| | * | SQL syntax fixRichard van der Hoff2016-07-271-1/+1
| | | |
| | * | Delete e2e keys on device deleteRichard van der Hoff2016-07-271-0/+15
| | | |
| | * | Make the device id on e2e key upload optionalRichard van der Hoff2016-07-261-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should now be able to get our device_id from the access_token, so the device_id on the upload request is optional. Where it is supplied, we should check that it matches. For active access_tokens without an associated device_id, we ought to register the device in the devices table. Also update the table on upgrade so that all of the existing e2e keys are associated with real devices.
| * | | Fix a couple of bugs in the transaction and keyring codeMark Haines2016-07-261-1/+2
| |/ /
| * | Fix typoRichard van der Hoff2016-07-261-1/+1
| | |
| * | Merge branch 'develop' into rav/delete_refreshtoken_on_delete_deviceRichard van der Hoff2016-07-261-50/+110
| |\ \
| | * \ Merge pull request #948 from matrix-org/markjh/auth_fixesMark Haines2016-07-261-50/+110
| | |\ \ | | | | | | | | | | Don't add rejections to the state_group, persist all rejections
| | | * | Fix how push_actions are redacted.Mark Haines2016-07-261-8/+10
| | | | |
| | | * | Don't add rejected events if we've seen them befrore. Add some comments to ↵Mark Haines2016-07-261-5/+48
| | | | | | | | | | | | | | | | | | | | explain what the code is doing mechanically
| | | * | Only update the events and event_json tables for rejected eventsMark Haines2016-07-252-52/+63
| | | | |
| | | * | Don't add the events to forward extremities if the event is rejectedMark Haines2016-07-251-3/+6
| | | | |
| | | * | Don't add rejections to the state_group, persist all rejectionsMark Haines2016-07-252-5/+6
| | | | |
| * | | | Delete refresh tokens when deleting devicesRichard van der Hoff2016-07-261-13/+45
| |/ / /
| * | | Implement updating devicesRichard van der Hoff2016-07-261-1/+26
| | | | | | | | | | | | | | | | You can update the displayname of devices now.
| * | | Implement deleting devicesRichard van der Hoff2016-07-264-4/+71
| |/ /
| * | fix: defer.returnValue takes one argumentMark Haines2016-07-251-1/+1
| | |
| * | background updates: fix assert againRichard van der Hoff2016-07-251-1/+1
| | |
| * | background updates: Fix assertion to do somethingRichard van der Hoff2016-07-251-2/+2
| | |
| * | Fix background_update testsRichard van der Hoff2016-07-251-7/+20
| | | | | | | | | | | | | | | | | | A bit of a cleanup for background_updates, and make sure that the real background updates have run before we start the unit tests, so that they don't interfere with the tests.
| * | PEP8Richard van der Hoff2016-07-221-1/+0
| | |
| * | Create index on user_ips in the backgroundRichard van der Hoff2016-07-223-12/+80
| | | | | | | | | | | | | | | | | | | | | | | | user_ips is kinda big, so really we want to add the index in the background once we're running. Replace the schema delta with one which will do that. I've done this in a way that's reasonably easy to reuse as there a few other indexes I need, and I don't suppose they will be the last.
* | | Add more key storage funcs into slave storeErik Johnston2016-07-281-18/+16
| | |
* | | Split out a FederationReader processErik Johnston2016-07-211-0/+4
|/ /
* | storage/client_ips: remove some dead codeRichard van der Hoff2016-07-211-3/+0
| |
* | Merge branch 'develop' into rav/get_devices_apiRichard van der Hoff2016-07-201-1/+2
|\ \ | | | | | | | | | (pick up PR #938 in the hope of fixing the UTs)
| * | Record device_id in client_ipsRichard van der Hoff2016-07-201-1/+2
| | | | | | | | | | | | | | | Record the device_id when we add a client ip; it's somewhat redundant as we could get it via the access_token, but it will make querying rather easier.
* | | GET /devices endpointRichard van der Hoff2016-07-203-1/+109
|/ / | | | | | | | | | | | | implement a GET /devices endpoint which lists all of the user's devices. It also returns the last IP where we saw that device, so there is some dancing to fish that out of the user_ips table.
* | More doc-commentsRichard van der Hoff2016-07-201-7/+12
| | | | | | | | Fix some more comments on some things
* | Merge pull request #932 from matrix-org/rav/register_refactorDavid Baker2016-07-201-2/+4
|\ \ | | | | | | Further registration refactoring
| * | Further registration refactoringRichard van der Hoff2016-07-191-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * `RegistrationHandler.appservice_register` no longer issues an access token: instead it is left for the caller to do it. (There are two of these, one in `synapse/rest/client/v1/register.py`, which now simply calls `AuthHandler.issue_access_token`, and the other in `synapse/rest/client/v2_alpha/register.py`, which is covered below). * In `synapse/rest/client/v2_alpha/register.py`, move the generation of access_tokens into `_create_registration_details`. This means that the normal flow no longer needs to call `AuthHandler.issue_access_token`; the shared-secret flow can tell `RegistrationHandler.register` not to generate a token; and the appservice flow continues to work despite the above change.
* | | Merge pull request #922 from matrix-org/erikj/file_api2Erik Johnston2016-07-203-1/+197
|\ \ \ | |/ / |/| | Feature: Add filter to /messages. Add 'contains_url' to filter.
| * | CommentErik Johnston2016-07-201-0/+4
| | |
| * | Add support for filters in paginate_room_eventsErik Johnston2016-07-141-1/+51
| | |
| * | Add sender and contains_url field to events tableErik Johnston2016-07-142-0/+142
| | |
* | | schema fixRichard van der Hoff2016-07-191-1/+1
| | | | | | | | | | | | device_id should be text, not bigint.
* | | Add device_id support to /loginRichard van der Hoff2016-07-185-10/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a 'devices' table to the storage, as well as a 'device_id' column to refresh_tokens. Allow the client to pass a device_id, and initial_device_display_name, to /login. If login is successful, then register the device in the devices table if it wasn't known already. If no device_id was supplied, make one up. Associate the device_id with the access token and refresh token, so that we can get at it again later. Ensure that the device_id is copied from the refresh token to the access_token when the token is refreshed.
* | | Fix /purge_history bugErik Johnston2016-07-151-19/+15
| | | | | | | | | | | | This was caused by trying to insert duplicate backward extremeties
* | | Pull out min stream_ordering from ex_outlier_streamErik Johnston2016-07-151-1/+2
| | |
* | | event_backwards_extremeties may not be emptyErik Johnston2016-07-151-1/+11
|/ /
* | Add a comment explaining allow_noneMark Haines2016-07-081-0/+2
| |
* | Ensure that the guest user is in the database when upgrading accountsMark Haines2016-07-081-0/+13
| |
* | Merge branch 'master' of github.com:matrix-org/synapse into developErik Johnston2016-07-083-3/+14
|\ \
| * \ Merge pull request #886 from matrix-org/markjh/async_commitMark Haines2016-06-293-3/+14
| |\ \ | | | | | | | | Optionally make committing to postgres asynchronous.
| | * | Optionally make committing to postgres asynchronous.Mark Haines2016-06-203-3/+14
| | | | | | | | | | | | | | | | | | | | Useful when running tests when you don't care whether the server will lose data that it claims that it has committed.
* | | | CommentErik Johnston2016-07-071-0/+3
| | | |
* | | | Return 400 rather than 500Erik Johnston2016-07-071-1/+4
| | | |
* | | | Add rest servlet. Fix SQL.Erik Johnston2016-07-061-5/+4
| | | |
* | | | Merge branch 'erikj/shared_secret' into erikj/test2Erik Johnston2016-07-063-83/+131
|\ \ \ \
| * | | | Remove spurious txnErik Johnston2016-07-051-9/+0
| | | | |
| * | | | Fix for postgresErik Johnston2016-07-051-2/+2
| | | | |
| * | | | Add an admin option to shared secret registrationErik Johnston2016-07-051-23/+38
| | | | |
| * | | | Fix typoMark Haines2016-07-051-1/+1
| | | | |
| * | | | Make get_events_around more efficient on sqlite3Mark Haines2016-07-051-13/+49
| | | | |
| * | | | Use true/false for boolean parameter inclusive to avoid potential for sqli, ↵Mark Haines2016-07-052-5/+7
| | | | | | | | | | | | | | | | | | | | and possibly make the code clearer
| * | | | Use different SQL for postgres and sqlite3 for when using multicolumn indexesMark Haines2016-07-042-59/+59
| | | | |
| * | | | Use a query that postgresql optimises better for get_events_aroundMark Haines2016-07-041-12/+16
| | | | |
* | | | | Add ReadWriteLock for pagination and history pruneErik Johnston2016-07-051-2/+2
| | | | |
* | | | | Add purge_history APIErik Johnston2016-07-051-0/+6
| | | | |
* | | | | Add storage function to purge history for a roomErik Johnston2016-07-041-0/+140
|/ / / /
* | | | Feature: Add deactivate account admin APIErik Johnston2016-06-302-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows server admins to "deactivate" accounts, which: - Revokes all access tokens - Removes all threepids - Removes password The API is a POST to `/admin/deactivate/<user_id>`
* | | | Implement purge_media_cache admin APIErik Johnston2016-06-291-0/+29
| | | |
* | | | Track approximate last access time for remote mediaErik Johnston2016-06-293-1/+47
| | | |
* | | | more pep8David Baker2016-06-241-1/+0
| | | |
* | | | Use similar naming we use in email notifs for pushDavid Baker2016-06-242-50/+0
| | | | | | | | | | | | | | | | Fixes https://github.com/vector-im/vector-web/issues/1654
* | | | Actually we need to order these properlyDavid Baker2016-06-221-2/+12
| | | | | | | | | | | | | | | | otherwise we'll end up returning the wrong 20
* | | | StyleDavid Baker2016-06-221-1/+1
| | | |
* | | | Put most recent 20 messages in notifDavid Baker2016-06-221-3/+4
|/ / / | | | | | | | | | Fixes https://github.com/vector-im/vector-web/issues/1648
* | | Add the create_profile method back since the tests use itMark Haines2016-06-171-0/+6
| | |
* | | Remove registered_users from the distributor.Mark Haines2016-06-172-9/+14
|/ / | | | | | | | | | | | | | | | | | | The only place that was observed was to set the profile. I've made it so that the profile is set within store.register in the same transaction that creates the user. This required some slight changes to the registration code for upgrading guest users, since it previously relied on the distributor swallowing errors if the profile already existed.
* | Don't hit DB for noop replications queriesErik Johnston2016-06-084-0/+12
| |
* | Remove dead code.Mark Haines2016-06-071-7/+0
| | | | | | | | | | | | | | | | | | | | | | Loading push rules now happens in the datastore, so we can remove the methods that loaded them outside the datastore. The ``waiting_for_join_list`` in federation handler is populated by anything, so can be removed. The ``_get_members_events_txn`` method isn't called from anywhere so can be removed.
* | Fix AS retries, but with correct orderingErik Johnston2016-06-071-2/+2
| |
* | Fix AS retriesErik Johnston2016-06-071-2/+2
| |
* | Merge pull request #841 from matrix-org/erikj/event_counterErik Johnston2016-06-061-0/+9
|\ \ | | | | | | Add metric counter for number of persisted events
| * | Add metric counter for number of persisted eventsErik Johnston2016-06-061-0/+9
| | |
* | | Add events to cache when we persist themErik Johnston2016-06-061-0/+41
|/ /
* | Don't rely on options when inserting event into cacheErik Johnston2016-06-031-40/+43
| |
* | Change the way we cache eventsErik Johnston2016-06-031-39/+41
| |