Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ingest required error #974

Merged
merged 2 commits into from
Feb 21, 2024
Merged

Ingest required error #974

merged 2 commits into from
Feb 21, 2024

Conversation

halgari
Copy link
Collaborator

@halgari halgari commented Feb 20, 2024

Resolves #871

It seems like the problem was mostly due to us storing the previous disk state keyed by LoadoutId instead of on the game version. One we switch to using the game version it all seems to work correctly. I'll do more testing on the CLI and we can create a new PR if this doesn't go far enough for some reason

@halgari halgari self-assigned this Feb 20, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2024

Codecov Report

Attention: 37 lines in your changes are missing coverage. Please review.

Comparison is base (8728b65) 0.00% compared to head (f4276d4) 58.14%.
Report is 1 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           main     #974       +/-   ##
=========================================
+ Coverage      0   58.14%   +58.14%     
=========================================
  Files         0      637      +637     
  Lines         0    20564    +20564     
  Branches      0     1572     +1572     
=========================================
+ Hits          0    11957    +11957     
- Misses        0     8246     +8246     
- Partials      0      361      +361     
Flag Coverage Δ
Linux 57.44% <32.72%> (?)
Windows 57.35% <32.72%> (?)
clean_environment_tests 58.12% <32.72%> (?)
macOS 56.83% <32.72%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
.../NexusMods.Abstractions.DiskState/DiskStateTree.cs 84.31% <100.00%> (ø)
...ons.Loadouts.Synchronizers/ALoadoutSynchronizer.cs 94.08% <100.00%> (ø)
.../NexusMods.DataModel/Loadouts/DiskStateRegistry.cs 96.42% <100.00%> (ø)
...sMods.DataModel.Tests/ALoadoutSynchronizerTests.cs 0.00% <0.00%> (ø)

... and 633 files with indirect coverage changes

@halgari
Copy link
Collaborator Author

halgari commented Feb 21, 2024

Confirmed by the CLI:

  • Managed Skyrim into a list called "BaseList1"
  • Managed Skyrim into a list called "MainList1"
  • Applied both lists (works fine)
  • Installed SKSE into "MainList1"
  • Applied both lists and verified files were added/removed with each apply
@halgari halgari requested a review from a team February 21, 2024 00:33
@Al12rs
Copy link
Contributor

Al12rs commented Feb 21, 2024

I want to test this locally, specifically adding outside changes to the test case above.

@Al12rs
Copy link
Contributor

Al12rs commented Feb 21, 2024

Tested the PR merge with main using the new Apply button (has the same logic for apply as LaunchButton had).
I tested a number of scenarios with two loadouts with and without outside changes.

Testing results:

  • Removing mods and Applying leaves empty folder structures in game folder
  • Creating a second loadout ingests the previously deployed loadout as the game files for that loadout.
  • Changes are ingested into the loadout currently being applied instead of being ingested into the last applied loadout
  • Outside changes are ingested and a new loadout is created but it is never used
    • When applying, outside changes are ingested, but then the original loadout is Applied
      • Outside changes are removed from file system and are not integrated in the loadout shown in the LoadoutGrid
    • Options:
      • Update user loadout with outside changes and apply the new loadout
      • Ingest outside changes into a branch of last applied loadout revision and keep that for users to decide what to do with.
  • The loadout revision ID saved with a DiskState is not guaranteed to have a flattened loadout that matches the DiskState (unapplied changes).
  • No way to get the Last Applied LoadoutId and the last applied loadout revision without also getting the entire last DiskState.
    • This is needed for Apply button UI logic (show which loadout is being applied and change diff) and knowing in which loadout to do the ingest.

Let me know if you want to handle any of these in this PR. We can discuss some of these in more details after standup

@halgari
Copy link
Collaborator Author

halgari commented Feb 21, 2024

Tested the PR merge with main using the new Apply button (has the same logic for apply as LaunchButton had). I tested a number of scenarios with two loadouts with and without outside changes.

Testing results:

  • Removing mods and Applying leaves empty folder structures in game folder

  • Creating a second loadout ingests the previously deployed loadout as the game files for that loadout.

  • Changes are ingested into the loadout currently being applied instead of being ingested into the last applied loadout

  • Outside changes are ingested and a new loadout is create but it is never used

    • When applying, outside changes are ingested, but then the original loadout is Applied

      • Outside changes are removed from file system and are not integrated in the loadout shown in the LoadoutGrid
    • Options:

      • Update user loadout with outside changes and apply the new loadout
      • Ingest outside changes into a branch of last applied loadout revision and keep that for users to decide what to do with.
  • The loadout revision ID saved with a DiskState is not guaranteed to have a flattened loadout that matches the DiskState (unapplied changes).

  • No way to get the Last Applied LoadoutId and the last applied loadout revision without also getting the entire last DiskState.

    • This is needed for Apply button UI logic (show which loadout is being applied and change diff) and knowing in which loadout to do the ingest.

Let me know if you want to handle any of these in this PR. We can discuss some of these in more details after standup

Let's put these in a separate issue and do a different PR for that

@halgari halgari merged commit 596d997 into main Feb 21, 2024
5 checks passed
@halgari halgari deleted the ingest-required-error branch February 21, 2024 12:20
@Sewer56
Copy link
Member

Sewer56 commented Feb 21, 2024

I also reviewed the code before falling asleep, just didn't comment on case tired me would say something silly.

In any case, there is one potential caveat I see here. I've heard mentions in the past of 'supporting multiple installations of the same game' at once within the team.

Because we serialize with key of Name|Version|Store, there's.no way to uniquely identify a second copy of the game with thebsame version.

Personally I think the point is moot since a user can only currently have 1 copy of the game per store anyway in the App (since we pull from e.g. Steam info and Steam can only have 1 copy).

I don't think it's worth investing effort in this area, but I figured it was worth pointing out since I've heard of the desire of multi copies per game a few times; and that would require changing ID format.

@halgari halgari restored the ingest-required-error branch March 6, 2024 22:11
@erri120 erri120 deleted the ingest-required-error branch March 27, 2024 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants