1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 07:27:25 +08:00
Commit Graph

30764 Commits

Author SHA1 Message Date
Dean Herbert
18bf690a30 Add Register method for subscription purposes and update safeties 2022-01-21 19:06:18 +09:00
Dean Herbert
2006620a2c Fix IntroScreen retrieving and iterating all realm beatmap sets 2022-01-21 18:03:16 +09:00
Dean Herbert
8f1dfa33a2 Merge branch 'master' into realm-context-use-update-when-feasible 2022-01-21 18:03:09 +09:00
Dean Herbert
495636538f Add forced refresh on GetAllUsableBeatmapSets()
This is commonly used in tests in a way where it's not feasible to
guarantee correct results unless a refresh is called. This method
shouldn't really be used outside of tests anyway, but that's for a
folow-up effort.
2022-01-21 17:33:29 +09:00
Dean Herbert
81b5717ae7 Fix RealmLive failing to retrieve due to lack of refresh 2022-01-21 17:33:03 +09:00
Dean Herbert
d2655c0825 Fix RealmLive not necessarily being in refreshed state due to potentially using update context 2022-01-21 17:27:30 +09:00
Dean Herbert
114c9e8c1f Update all usages of CreateContext to use either Run or Write 2022-01-21 17:27:08 +09:00
Dean Herbert
da0a803e6c Add RealmContextFactory.Write helper method 2022-01-21 17:08:05 +09:00
Dean Herbert
a59105635e Make CreateContext private 2022-01-21 16:40:20 +09:00
Dean Herbert
dde10d1ba2 Remove unused IRealmFactory interface 2022-01-21 16:38:07 +09:00
Dean Herbert
3bcdce128c Use dictionary add for safety 2022-01-21 15:29:21 +09:00
Dean Herbert
ff4f40db8a Merge branch 'master' into carousel-performance-n 2022-01-21 15:27:42 +09:00
Dan Balasescu
c4f24ef96c
Merge pull request #16542 from peppy/carousel-search-performance-less-simple
Avoid performing full filter when updating carousel beatmap sets
2022-01-21 15:05:30 +09:00
Dean Herbert
5622d2ba4f Show realm migration progress at Loader 2022-01-21 14:56:49 +09:00
Dean Herbert
5be41a189b Expose EF context factory for use in external migration logic 2022-01-21 14:56:28 +09:00
Dan Balasescu
d6d9efae60
Merge pull request #16541 from peppy/carousel-search-performance-simple
Avoid performing keyword filtering at song select unless keywords are specified
2022-01-21 13:35:43 +09:00
Dean Herbert
bed7b69464 Apply NRT to CarouselGroup 2022-01-21 13:26:29 +09:00
Dean Herbert
5b24800b0e Avoid applying filter in UpdateBeatmapSet flow 2022-01-21 13:26:25 +09:00
Dean Herbert
45bf35c425 Avoid performing keyword filtering at song select unless keywords are specified 2022-01-21 12:26:24 +09:00
Dean Herbert
a5d2047f05 Fix various cases of creating realm contexts from update thread when not necessary 2022-01-21 01:44:56 +09:00
Dean Herbert
0c9eb3ad61 Add realm factory helper methods to run work on the correct context
Avoids constructing a new `Realm` instance when called from the update
thread without worrying about disposal.
2022-01-21 01:33:47 +09:00
Dean Herbert
7aad2780b1 Add retry logic for realm backup creation 2022-01-21 00:46:53 +09:00
Dean Herbert
079b2dfc42 Create backup of databases before opening contexts
Attempt to avoid file IO issues.

Closes #16531.
2022-01-21 00:46:53 +09:00
Dean Herbert
ba31ddee01 Revert beatmapSets reference to fix tests
New version changed order.
2022-01-21 00:34:12 +09:00
Dean Herbert
80f3a67876 Use for instead of foreach to avoid enumerator overhead 2022-01-20 22:21:00 +09:00
Dean Herbert
0b93f3c88f Add <Guid,CarouselBeatmapSet> dictionary to speed up update operations in carousel 2022-01-20 22:12:49 +09:00
Dean Herbert
9a864267d2 Fix CarouselGroupEagerSelect not invoking subclassed AddChild from AddChildren calls 2022-01-20 21:57:16 +09:00
Dean Herbert
a8ce2c5edf Detach before sending BeatmapSetInfo to any handling method 2022-01-20 21:14:10 +09:00
Dan Balasescu
1a20725162
Merge pull request #16529 from peppy/fix-realm-subscription-overhead
Remove all calls to `Realm.Refresh` to fix blocking overhead from subscriptions
2022-01-20 20:58:11 +09:00
Dan Balasescu
c986c1b702
Merge pull request #16523 from peppy/realm-async-carousel-load
Use asynchronous loading for beatmap carousel again
2022-01-20 20:55:48 +09:00
Dean Herbert
5df46d0a54 Remove all calls to Realm.Refresh to fix blocking overhead from subscriptions
Turns out this is not required if realm is aware of a
`SynchronizationContext`. See
https://github.com/realm/realm-dotnet/discussions/2775#discussioncomment-2005412
for further reading.
2022-01-20 20:23:18 +09:00
Dean Herbert
b1cf3befa6 Fix incorrect query in comment 2022-01-20 18:36:20 +09:00
Dan Balasescu
cab63830a1
Merge pull request #16527 from peppy/remove-parameterless-beatmapinfo-ctor-usage
Avoid constructor allocation/GC overhead in realm implicit constructors
2022-01-20 18:11:35 +09:00
Dean Herbert
3ba712703b Add a note about hidden beatmap check 2022-01-20 17:50:17 +09:00
Dean Herbert
4235fb317d Remove unnecessary detach operation 2022-01-20 17:35:32 +09:00
Dean Herbert
0bd7486a83 Avoid constructor overhead for realm SkinInfo parameterless constructor 2022-01-20 17:29:07 +09:00
Dean Herbert
70cc03fe43 Avoid constructor overhead for realm RealmKeyBinding parameterless constructor 2022-01-20 17:29:07 +09:00
Dean Herbert
6c10531df2 Avoid constructor overhead for realm BeatmapMetadata parameterless constructor 2022-01-20 17:14:51 +09:00
Dean Herbert
deb108816c Fix some regressions in json output (we need to make all these explicit instead) 2022-01-20 17:09:31 +09:00
Dean Herbert
ccddf9b47d Avoid constructor overhead for realm BeatmapSetInfo parameterless constructor 2022-01-20 17:03:44 +09:00
Dean Herbert
3c852e6d02 Avoid constructor overhead for realm ScoreInfo parameterless constructor 2022-01-20 16:47:27 +09:00
Dean Herbert
3faf980fed Avoid constructor overhead for realm BeatmapInfo parameterless constructor 2022-01-20 16:47:27 +09:00
Dean Herbert
1dabf6c8a5 Fix BeatmapCarousel signalling it is finished loading before catching up on realm changes 2022-01-20 16:39:42 +09:00
Dan Balasescu
64fe7d8dd3
Merge pull request #16520 from peppy/refresh-after-migrate
Improve realm migration performance further
2022-01-20 14:38:23 +09:00
Dan Balasescu
7509b31176
Merge pull request #16519 from peppy/fix-legacy-score-import-classic-mod
Fix legacy score imports not correctly getting classic mod assigned
2022-01-20 14:28:29 +09:00
Dan Balasescu
4f86a2cb61
Merge pull request #16525 from bdach/beatmap-listing-overflow-and-scrolling
Improve usability of expanded card content on beatmap listing
2022-01-20 14:14:44 +09:00
Bartłomiej Dach
b8184a3005
Fix news sidebar assuming returned posts are always from given year 2022-01-19 23:13:30 +01:00
Bartłomiej Dach
4cad5890c6
Add test coverage for news sidebar showing wrong headers 2022-01-19 23:12:35 +01:00
Bartłomiej Dach
247c557eaf
Fix expanded content scrollbar inadvertently hiding expanded content 2022-01-19 22:30:49 +01:00
Bartłomiej Dach
77748a5f93
Show scrollbar on expanded card content where applicable 2022-01-19 22:21:08 +01:00
Bartłomiej Dach
33ab356dc5
Fix expanded card content being clipped on beatmap listing overlay 2022-01-19 22:10:05 +01:00
Dean Herbert
a27a3b308c Remove duplicate setters 2022-01-20 04:34:00 +09:00
Dean Herbert
6c46fd6931 Fix some failing tests due to realm beatmaps overwriting test beatmaps 2022-01-20 00:19:16 +09:00
Dean Herbert
9435464eb3
Merge branch 'master' into realm-async-carousel-load 2022-01-19 18:25:31 +09:00
Dean Herbert
4b127d5029
Merge pull request #16522 from peppy/detach-before-hidden-check
Detach beatmap set before checking hidden state
2022-01-19 18:25:23 +09:00
Dean Herbert
2789986699 Use asynchronous loading for beatmap carousel again 2022-01-19 18:15:43 +09:00
Dan Balasescu
ddd1699621
Merge pull request #16521 from peppy/backup-collections
Backup collections alongside main databases when migrating to realm
2022-01-19 17:02:49 +09:00
Dean Herbert
200fcb6f83 Detach beatmap set before checking hidden state 2022-01-19 16:59:49 +09:00
Dean Herbert
fad66d7682 Backup collections alongside main databases when migrating to realm 2022-01-19 16:31:36 +09:00
Dean Herbert
aa93042aa3 Centralise backup code and also run on skin/settings migrations 2022-01-19 16:31:36 +09:00
Dean Herbert
fd5198d667 Avoid using parameterless constructors in migration code
Minor performance improvement (less garbage).
2022-01-19 16:22:18 +09:00
Dean Herbert
42736c9995 Add transactional committing of scores/beatmaps
This helps slightly with performance, allows better monitoring via realm
studio, but most importantly greatly reduces filesize.

fully compacted:        109M
transaction size 100:   115M
transaction size 1000:  123M
transaction size 10000: 164M
single transaction:     183M

With a transaction size of 100 there is a performance reduction, so 1000
seems to be the best middle-ground.
2022-01-19 16:08:48 +09:00
Dean Herbert
973836484c Avoid using a write context for EF migration
This reduces a stall delay as EF tries to process changes over tracked
objects during disposal of the context.
2022-01-19 15:56:58 +09:00
Dean Herbert
faec62be51 Force a realm refresh after migration
This really shouldn't have much effect as it will be run in the first
`Update` method and is probably a noop (we are already pointing to the
newest version due to just performing writes), but seems like a safe addition.

In general `Realm.Refresh()` only really does anything when there's multithreaded
usage and notifications to be sent.
2022-01-19 15:56:58 +09:00
Dan Balasescu
9920ff51a6
Merge pull request #16446 from peppy/summary-timeline-control-point-optimisation
Reduce number of redundant control points displayed on summary timeline
2022-01-19 15:51:20 +09:00
Dan Balasescu
2475a62f2d
Merge pull request #16518 from nekodex/participantlist-cleanup
Remove unused BDL parameter in `ParticipantList`
2022-01-19 14:59:40 +09:00
Dean Herbert
5f5765d6a2 Reduce redundancy time range to create a bit more visual blending on the timeline 2022-01-19 14:57:01 +09:00
Dean Herbert
03ac91a3ee Consider all points in a group to meet redundancy check 2022-01-19 14:56:44 +09:00
Dean Herbert
93cd07f7fb Merge branch 'master' into summary-timeline-control-point-optimisation 2022-01-19 14:50:45 +09:00
Dan Balasescu
fdf65aa2ff
Merge pull request #16502 from peppy/realm/remove-ef-migrations
Remove all EF migrations and helper methods
2022-01-19 14:43:45 +09:00
Dan Balasescu
aa6466dfa4
Merge pull request #16499 from peppy/realm-integration/faster-migration
Improve performance of migration to realm
2022-01-19 14:43:33 +09:00
Dean Herbert
18886f5d2e Use empty string instead of empty array for ModsJson when no mods are present
Not really correct, but this is how most scores have been stored until
now so let's do this for consistency.
2022-01-19 14:34:27 +09:00
Dean Herbert
664b4fdaf0 Fix legacy score imports not correctly getting classic mod assigned 2022-01-19 14:34:27 +09:00
Dan Balasescu
581873f944
Merge pull request #16497 from peppy/top-local-rank-optimisation
Rewrite `TopLocalRank` to use realm subscriptions
2022-01-19 14:22:12 +09:00
Jamie Taylor
493a970ed5
Remove unused AudioManager 2022-01-19 14:08:21 +09:00
Dan Balasescu
3407b34b11
Merge branch 'master' into realm/remove-ef-migrations 2022-01-19 14:01:34 +09:00
Dan Balasescu
0b1736def6
Merge branch 'master' into realm-integration/faster-migration 2022-01-19 13:54:14 +09:00
Dan Balasescu
3e5d29ed00
Merge pull request #16505 from peppy/remove-base-difficulty-usage
Remove all usage of `BaseDifficulty` (and access `Difficulty` instead)
2022-01-19 13:53:55 +09:00
Dan Balasescu
9c8f7795b7
Merge pull request #16510 from peppy/optimise-set-detach-part-2
Avoid file retrieval overhead when detaching `BeatmapSetInfo`
2022-01-19 13:53:34 +09:00
Dan Balasescu
a0336c6fc2
Merge pull request #16495 from peppy/realm-integration/reinit-on-corrupt
Add support for starting with a fresh realm database if the existing one is not usable
2022-01-19 13:30:14 +09:00
Dean Herbert
9be5bf38c6 Simplify binding/invalidation in TopLocalRank 2022-01-19 13:20:52 +09:00
Dan Balasescu
2556f1cb87
Merge branch 'master' into optimise-set-detach-part-2 2022-01-19 13:20:38 +09:00
Dan Balasescu
d663fcd045
Merge pull request #16508 from peppy/optimise-set-detach
Create separate automapper configurations to reduce cyclic detach overhead
2022-01-19 13:20:25 +09:00
Dean Herbert
e60fd358d0 Merge branch 'master' into top-local-rank-optimisation 2022-01-19 13:04:14 +09:00
Dean Herbert
d440197fb3 Merge branch 'master' into realm-integration/faster-migration 2022-01-19 12:56:42 +09:00
Dean Herbert
2363130f8b Add back BaseDifficulty with obsoletion counter to account for custom rulesets 2022-01-19 12:33:56 +09:00
Dean Herbert
ad4d9789ad Merge branch 'master' into realm-integration/reinit-on-corrupt 2022-01-19 12:31:56 +09:00
Dan Balasescu
f6f44029e8
Merge pull request #16507 from peppy/more-ingore-rules
Add some missing `IgnoredAttributes` to reduce automapper overhead
2022-01-19 12:26:37 +09:00
Dean Herbert
fb558a3189 Merge branch 'master' into realm-integration/reinit-on-corrupt 2022-01-19 12:26:24 +09:00
Dan Balasescu
8c120c6bfb
Merge pull request #16491 from peppy/realm-integration/safer-migration
Improve safety and logging of realm migration process
2022-01-19 12:23:48 +09:00
Dan Balasescu
c52899b1fb Rename property 2022-01-19 11:56:44 +09:00
Dean Herbert
261b4988f9 Only catch RealmExceptions to avoid blocking the nested TimeoutException 2022-01-19 10:58:59 +09:00
Dean Herbert
195534a1d2 Only output "successful" messages when copy actually occurred 2022-01-19 10:31:13 +09:00
Dean Herbert
e1a35714be Add notification for debug builds when database migration occurs 2022-01-19 10:31:10 +09:00
Dean Herbert
04e9ffa966 Freshen some comments 2022-01-19 10:20:56 +09:00
Dean Herbert
64a023665e Avoid taking more than one backup per migration run 2022-01-19 10:20:56 +09:00
Dean Herbert
3bc091fe6d Add ignore rules on more helper properties 2022-01-19 09:46:45 +09:00
Dean Herbert
761e161eec Add comment explaining ignore rule 2022-01-19 09:44:21 +09:00
Dean Herbert
60b80c88b6 Avoid file retrieval overhead when detaching BeatmapSetInfo
It seems that no usages of `BeatmapSetInfo` detaches require files - a
`WorkingBeatmap` is always obtained before doing further lookups.

Therefore we can omit this include unless the detaching object is a
`BeatmapInfo`. A refetch is performed when retrieving a
`WorkingBeatmap` to complete the equation.
2022-01-19 00:49:18 +09:00
Dean Herbert
f2b151023e Create separate automapper configurations to reduce cyclic detach overhead
This optimises the `BeatmapSetInfo` detach operation by avoiding
detaching `BeatmapSetInfo.Beatmaps[].BeatmapSetInfo` a second time over.
2022-01-19 00:03:24 +09:00
Dean Herbert
67bf95bc91 Remove all usage of AuthorString 2022-01-18 23:30:40 +09:00
Dean Herbert
3596c6ed5d Add some missing IgnoredAttributes to reduce automapper overhead 2022-01-18 23:25:30 +09:00
Dean Herbert
7f65f3a47f Remove all usage of BaseDifficulty (and access Difficulty instead) 2022-01-18 22:57:39 +09:00
Dean Herbert
6b0bf38c93 Use a single EF context to avoid scores getting cascade deleted along the way 2022-01-18 20:47:53 +09:00
Dean Herbert
6ddd2d59d3 Remove EF helper methods 2022-01-18 20:44:26 +09:00
Dean Herbert
bb5b9458e8 Remove all EF migrations 2022-01-18 20:42:48 +09:00
Dean Herbert
f5b8653491 Add spaces to query string 2022-01-18 19:28:09 +09:00
Dean Herbert
519f7e6ad2 Don't bother with removing from EF as the file is going to be deleted anyway 2022-01-18 19:17:47 +09:00
Dean Herbert
3b0977903b Use IQueryable directly to avoid insane overheads 2022-01-18 19:17:47 +09:00
Dean Herbert
27ea37c690 Rewrite TopLocalRank to use realm subscriptions
This addresses the number one performance concern with realm (when
entering song select). Previous logic was causing instantiation and
property reads of every score in the database due to the `AsEnumerable`
specfication.
2022-01-18 18:17:53 +09:00
Dean Herbert
02baad30d7 Merge branch 'master' into global-bindable-thread-safety 2022-01-18 18:12:00 +09:00
Dean Herbert
d10d657073
Merge pull request #16421 from Susko3/textbox-AllowIme-false
Add `AllowIme => false` to text boxes where applicable
2022-01-18 18:02:47 +09:00
Dean Herbert
49fcff190a
Merge branch 'master' into realm-integration/reinit-on-corrupt 2022-01-18 18:02:23 +09:00
Dean Herbert
7baada2fa6
Merge branch 'master' into realm-integration/safer-migration 2022-01-18 18:01:46 +09:00
Dan Balasescu
73a1f27ce5
Merge branch 'master' into realm-integration/score-and-beatmaps 2022-01-18 17:31:37 +09:00
Dean Herbert
39c9c4985b
Merge branch 'master' into textbox-AllowIme-false 2022-01-18 17:03:51 +09:00
Dean Herbert
488f044924 Remove one more outdated comment 2022-01-18 16:46:14 +09:00
Dean Herbert
8b8940439e Fix starting game with non-default ruleset failing 2022-01-18 16:22:15 +09:00
Dean Herbert
246a4a4bfe Add support for starting with a fresh realm database if the existing one is not usable
The most common scenario is switching between schema versions when
testing. This should alleviate the manual overhead of that for the
majority of cases.

For users, this will show a notification on startup if their database
was purged, similar to what we had with EF.
2022-01-18 16:05:13 +09:00
Dan Balasescu
b4fdd8a986
Merge pull request #16489 from peppy/aggregate-score-tests
Add test coverage of aggregate scores displaying correctly at multiplayer/playlists screens
2022-01-18 16:03:06 +09:00
Dean Herbert
a5862ca00d Improve reliability of mod deserialisation 2022-01-18 15:46:27 +09:00
Dean Herbert
9a43ed742b Update automapper spec in line with v11
See https://docs.automapper.org/en/latest/11.0-Upgrade-Guide.html for
 more details.
2022-01-18 15:23:28 +09:00
Dean Herbert
1b62a685f3 Merge branch 'master' into realm-integration/score-and-beatmaps 2022-01-18 15:07:59 +09:00
Dean Herbert
3429fd8768 Fix transaction scope and add even more logging 2022-01-18 14:47:00 +09:00
Dean Herbert
bf50a9b8f8 Also backup the realm database before migration 2022-01-18 14:30:41 +09:00
Dean Herbert
2b1c15b6cc Allow BlockAllOperations to be called from a non-update thread if update has never run 2022-01-18 14:30:32 +09:00
Dean Herbert
cf30d48721 Add more logging during migration process 2022-01-18 14:21:33 +09:00
Dean Herbert
798482c941 Create backups before deleting scores and beatmaps from EF database 2022-01-18 14:21:33 +09:00
Dean Herbert
b1a75ce480 Permanently delete client.db after migration completes 2022-01-18 14:17:43 +09:00
Dean Herbert
a714941f93 Rename EF variable to make reading code easier 2022-01-18 14:06:22 +09:00
Dean Herbert
d26f4d50bd Add test coverage of aggregate room scores displaying correctly 2022-01-18 14:00:12 +09:00
Dean Herbert
da9a60a695 Update broken test scenes to match new OsuTestScene logic 2022-01-18 13:41:50 +09:00
Dean Herbert
b9aae5569f Fix OsuTestScene potentially mutating global bindables 2022-01-18 13:29:24 +09:00
Dean Herbert
b9ec860cf2 Ensure global beatmap/ruleset are always mutated from the update thread
This came up while testing the new realm thread, where `MusicController`
would fall over when `OsuTestScene` changes the global beatmap from an
async load thread (causing a cross-thread realm access).

We don't want to have to schedule every usage of these bindables, so
this seems like a good constraint to put in place.
2022-01-18 13:29:24 +09:00
Dean Herbert
ebc9d3a613 Fix playlist aggregate scores not displaying (again) 2022-01-18 11:57:38 +09:00
Dean Herbert
a7db793d8c Specify realm pipe path location
I can't confirm this works yet, since I'm not sure what the
preconditions are for the `.note` file to be created. What I can confirm
is that a `.note` file hasn't appeared in my game data directory yet.
2022-01-18 11:43:23 +09:00
Dean Herbert
f9c5000774 Remove obsoleted sentry disposal call and fix incorrectly unbound logger event 2022-01-18 11:27:28 +09:00
Dean Herbert
911a837f62 Update framework 2022-01-18 11:09:35 +09:00
Dean Herbert
125439d177 Update all (non-NET6) nuget packages 2022-01-18 11:09:26 +09:00
MK56
31592e2995
Merge branch 'ppy:master' into Liswiera-FL-changes 2022-01-17 15:19:29 +01:00
Dan Balasescu
e9c96908d5
Merge pull request #16481 from peppy/fix-scores-container-tests
Rewrite `TestSceneScoresContainer` to work again
2022-01-17 20:39:14 +09:00
Dean Herbert
12fd279b7d Add test to check full flow of rebinding gameplay key bindings
Addresses a regression found in realm PR that was not covered by tests.
2022-01-17 16:00:17 +09:00
Dean Herbert
51ade3251d Improve ScoresContainer loading overlay logic to work better with tests 2022-01-17 15:15:39 +09:00
Dean Herbert
381174e482 Give the placeholder ruleset better defaults to allow tests to work again 2022-01-17 14:40:00 +09:00
Dean Herbert
a0e2106468 Guard against null values getting inserted into database during score/beatmap imports 2022-01-17 14:05:08 +09:00
Dean Herbert
744084b418 Initialise all parameters is paramaterless constructor for now for added safety 2022-01-17 13:51:30 +09:00
Dean Herbert
11ca1b6e7b Remove one more usage of IsManaged which could potentially go wrong 2022-01-17 13:40:27 +09:00
Dean Herbert
d27ee2c9fb Remove incorrect IsManaged check in ScoreManager 2022-01-17 13:37:42 +09:00
Dean Herbert
a3806f44a5 Add back null beatmap allowance to GetTotalScore flow to fix playlist aggregate scores 2022-01-17 13:11:43 +09:00
Dean Herbert
88bf406c22 Fix null reference in equality comparison causing beatmap set overlay to crash 2022-01-17 13:05:55 +09:00