1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 13:07:24 +08:00
osu-lazer/osu.Game/Database
Bartłomiej Dach 0e52797f29
Prefer not deleted models when picking model instances for reuse when importing
This fell out while investigating why the issue with online IDs
mismatching in the `.osu` could be worked around by importing the map
three times in total when starting from it not being available locally.

Here follows an explanation of why that "helped".

Import 1:
- The beatmap set is imported normally.
- Online metadata population sees the online ID mismatch and resets it
  on the problematic beatmap.

Import 2:
- The existing beatmap set is found, but deemed not reusable
  because of the single beatmap having its ID reset to -1.
- The existing beatmap set is marked deleted, and all the IDs of
  its beatmaps are reset to -1.
- The beatmap set is reimported afresh.
- Online metadata population still sees the online ID mismatch
  and resets it on the problematic beatmap.

Note that at this point the first import *is still physically present
in the database* but marked deleted.

Import 3:
- When trying to find the existing beatmap set to see if it can be
  reused, *the one pending deletion and with its IDs reset -
  - the remnant from import 1 - is returned*.
- Because of this, `validateOnlineIds()` resets online IDs
  *on the model representing the current reimport*.
- The beatmap set is reimported yet again.
- With the online ID reset, the online metadata population check for
  online ID mismatch does not run because *the IDs were reset to -1*
  earlier.

Preferring undeleted models when picking the model instance for reuse
prevents this scenario.
2024-10-30 08:18:44 +01:00
..
BackgroundDataStoreProcessor.cs Rename enum to non-plural now that it won't conflict 2024-10-01 19:55:46 +09:00
BeatmapExporter.cs Change .olz to use UTF-8 encoding 2024-04-30 21:40:04 +08:00
BeatmapLookupCache.cs Apply NRT in MemoryCachingComponent subclasses too 2023-06-09 13:47:35 +02:00
DetachedBeatmapStore.cs Rename and xmldoc RealmResetEmptySet 2024-10-09 14:18:34 +09:00
ExternalEditOperation.cs More xmldoc across new methods and classes 2024-07-10 18:34:48 +09:00
ICanAcceptFiles.cs Automated pass 2023-06-24 01:00:03 +09:00
IHasFiles.cs Manual fixes to reduce warnings to zero 2023-06-24 01:52:53 +09:00
IHasGuidPrimaryKey.cs Automated pass 2023-06-24 01:00:03 +09:00
IHasNamedFiles.cs Automated pass 2023-06-24 01:00:03 +09:00
IHasOnlineID.cs Automated #nullable processing 2022-06-17 16:37:17 +09:00
IHasPrimaryKey.cs Automated pass 2023-06-24 01:00:03 +09:00
IHasRealmFiles.cs Remove IScoreInfo : IHasNamedFiles inheritance 2023-10-26 14:58:33 +02:00
IModelDownloader.cs Automated #nullable processing 2022-06-17 16:37:17 +09:00
IModelFileManager.cs Automated pass 2023-06-24 01:00:03 +09:00
IModelImporter.cs Fix(?) xmldoc 2024-07-10 19:22:49 +09:00
IModelManager.cs Automated pass 2023-06-24 01:00:03 +09:00
ImportParameters.cs Fix skin editor freezing game if opened during active gameplay 2023-10-27 14:34:30 +02:00
ImportProgressNotification.cs Partial everything 2022-11-27 00:00:27 +09:00
ImportTask.cs Bring back disposal of stream after copy-out to MemoryStream 2023-09-14 19:36:35 +02:00
INamedFile.cs Automated #nullable processing 2022-06-17 16:37:17 +09:00
INamedFileInfo.cs Automated pass 2023-06-24 01:00:03 +09:00
INamedFileUsage.cs Automated #nullable processing 2022-06-17 16:37:17 +09:00
IPostNotifications.cs Automated pass 2023-06-24 01:00:03 +09:00
ISoftDelete.cs Remove redundant nullable suppression directives 2023-06-07 08:20:41 +03:00
LegacyArchiveExporter.cs Fix formatting 2024-04-30 21:47:03 +08:00
LegacyBeatmapExporter.cs Truncate break times for legacy beatmap export 2024-06-26 16:20:56 +09:00
LegacyBeatmapImporter.cs Fix legacy beatmap importer not always handling nested paths correctly 2023-10-03 16:01:17 +09:00
LegacyCollectionImporter.cs Fix re-importing existing collections not correctly adding new items 2022-08-16 16:43:05 +09:00
LegacyExporter.cs Move lower and xmldoc GetFilename(TModel) 2023-05-06 19:29:08 +02:00
LegacyImportManager.cs Update HasFlag usages 2024-07-03 00:19:04 +09:00
LegacyModelImporter.cs Move ImportParameters to better home 2022-12-13 21:41:26 +09:00
LegacyScoreExporter.cs Mark exporter extensions as untranslatable 2023-05-06 19:42:28 +02:00
LegacyScoreImporter.cs Path.GetExtension() will not get null 2023-02-19 02:56:53 +09:00
LegacySkinExporter.cs Mark exporter extensions as untranslatable 2023-05-06 19:42:28 +02:00
LegacySkinImporter.cs create a task to export to avoid block main thread 2022-11-17 01:08:06 +09:00
Live.cs Fix the MOTHERLOAD of undetected issues that are now visible thanks to net6.0 2022-12-16 18:16:26 +09:00
MemoryCachingComponent.cs Apply NRT to MemoryCachingComponent classes 2023-06-09 19:00:05 +09:00
MissingBeatmapNotification.cs Fix notification text sets overwriting each other 2023-09-19 11:12:58 +02:00
ModelDownloader.cs Merge branch 'master' into guard-url-protocols 2022-12-16 18:23:16 +09:00
ModelManager.cs Add feedback to delete button even when no-op 2024-02-18 21:52:23 -08:00
OnlineLookupCache.cs Apply NRT to MemoryCachingComponent classes 2023-06-09 19:00:05 +09:00
RealmAccess.cs Don't delete scores when deleting beatmaps 2024-10-22 01:39:05 +09:00
RealmArchiveModelImporter.cs Prefer not deleted models when picking model instances for reuse when importing 2024-10-30 08:18:44 +01:00
RealmExtensions.cs Fill out xmldoc and adjust inline commentary 2023-08-16 09:40:46 +02:00
RealmFileStore.cs Reference property via nameof rather than hardcoding 2024-01-09 11:49:42 +01:00
RealmLive.cs Add helper method for safer realm Find<T> 2023-08-16 15:37:09 +09:00
RealmLiveUnmanaged.cs Automated #nullable processing 2022-06-17 16:37:17 +09:00
RealmObjectExtensions.cs Inhibit original callback from firing when sending initial changeset 2024-07-09 16:05:58 +09:00
RealmResetEmptySet.cs Rename and xmldoc RealmResetEmptySet 2024-10-09 14:18:34 +09:00
StandardisedScoreMigrationTools.cs Compute total score without mods during standardised score conversion 2024-05-21 13:11:08 +02:00
TooManyDownloadsNotification.cs Partial everything 2022-11-27 00:00:27 +09:00
UserLookupCache.cs Use lookup request in user lookup cache 2024-10-08 14:05:27 +02:00