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

fix: various issues after ent refactor #75

Merged
merged 9 commits into from
Jun 24, 2024
Merged

fix: various issues after ent refactor #75

merged 9 commits into from
Jun 24, 2024

Conversation

mircearoata
Copy link
Member

  • check for either the email or oauth ID matching when logging in
    • in production, logging in was checking if either the email or oauth ID were matching an existing user
    • I changed my email default github email since signing up, so checking that both are equal would not allow me to sign in
    • if checking for both being equal, no account linking would be possible, and the unique email address constraint would also error when logging in with the same email from a different oauth provider
  • reindexing mod files was endlessly fetching the 101-200 mods, instead of using the current offset
  • query.Clone() discards the effects of Modify, so we take the embedded struct instead, which contains the wanted effects of Modify
    • this was also causing the custom last version date ordering to not have any effect
  • build custom predicates that contain arguments with ent methods
    • ent uses PREPARE, and postgres doesn't seem to support question mark arguments in those, even though their docs show that as an example
  • query tags in usermod.Mod resolver
    • it's queried on the user page, and the tags field was null, even though the GQL schema specifies a non-null array
    • not really a permanent fix, as there are other places that return a Mod but don't query its tags, resulting in a null tags array
  • don't return an error in the dataloader when a mod has no versions, or a version has no dependencies
  • check and update existing UserMod entries
    • previously, each authr entry in the updateMod attempted to create a new UserMod entry, which errored because of the unique index

@Vilsol Vilsol merged commit 4a30196 into staging Jun 24, 2024
6 of 7 checks passed
Copy link

codecov bot commented Jun 24, 2024

Codecov Report

Attention: Patch coverage is 8.33333% with 55 lines in your changes missing coverage. Please review.

Project coverage is 15.96%. Comparing base (65bcbc9) to head (4d8a9fc).
Report is 59 commits behind head on staging.

Files Patch % Lines
gql/resolver_mods.go 0.00% 17 Missing ⚠️
db/mod.go 23.52% 13 Missing ⚠️
db/oauth.go 0.00% 5 Missing ⚠️
dataloader/loaders.go 0.00% 4 Missing ⚠️
gql/resolver_guides.go 0.00% 4 Missing ⚠️
gql/resolver_sml_versions.go 0.00% 4 Missing ⚠️
gql/resolver_versions.go 0.00% 4 Missing ⚠️
gql/resolver_tags.go 0.00% 3 Missing ⚠️
gql/resolver_users.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging      #75      +/-   ##
===========================================
- Coverage    17.06%   15.96%   -1.11%     
===========================================
  Files          102      234     +132     
  Lines         5374    59523   +54149     
===========================================
+ Hits           917     9502    +8585     
- Misses        4356    47975   +43619     
- Partials       101     2046    +1945     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Vilsol Vilsol deleted the staging-fixes branch June 24, 2024 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants