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

SF-2860 Fix offline project add question error #2966

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

siltomato
Copy link
Collaborator

@siltomato siltomato commented Jan 21, 2025

Fixes issue where adding a question with empty xforge indexeddb database would throw an error (see Jira for video capture).


This change is Reviewable

@siltomato siltomato added bug Something isn't working will require testing PR should not be merged until testers confirm testing is complete labels Jan 21, 2025
@siltomato siltomato marked this pull request as ready for review January 21, 2025 01:07
Copy link
Collaborator Author

@siltomato siltomato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion


src/SIL.XForge.Scripture/ClientApp/src/app/checking/question-dialog/question-dialog.service.ts line 108 at r1 (raw file):

  private async canCreateAndEditQuestions(projectId: string): Promise<boolean> {
    const userId = this.userService.currentUserId;
    const project = (await this.projectService.getProfile(projectId)).data;

I'm not sure about this change. This seemed to work for retrieving a project profile doc, where get(projectId) to get a project doc would not when offline. Could this be because the project profile docs were loaded before I went offline on the project connect page?

@siltomato siltomato force-pushed the fix/sf-2860-offline-project-connect-error branch from 188fddf to 9a75a12 Compare January 21, 2025 13:35
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.08%. Comparing base (333c5d3) to head (7259515).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2966   +/-   ##
=======================================
  Coverage   82.08%   82.08%           
=======================================
  Files         544      544           
  Lines       31637    31637           
  Branches     5147     5142    -5     
=======================================
  Hits        25969    25969           
  Misses       4901     4901           
  Partials      767      767           

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

@Nateowami
Copy link
Collaborator

Please update the title to conform to the guidelines in CONTRIBUTING.md.

@siltomato siltomato changed the title SF-2860 Offline project add question error SF-2860 Fix offline project add question error Jan 21, 2025
@Nateowami
Copy link
Collaborator

Thanks @siltomato

@pmachapman pmachapman self-requested a review January 21, 2025 22:10
@pmachapman pmachapman self-assigned this Jan 21, 2025
Copy link
Collaborator

@pmachapman pmachapman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @siltomato)


src/SIL.XForge.Scripture/ClientApp/src/app/checking/question-dialog/question-dialog.service.ts line 108 at r1 (raw file):

Previously, siltomato wrote…

I'm not sure about this change. This seemed to work for retrieving a project profile doc, where get(projectId) to get a project doc would not when offline. Could this be because the project profile docs were loaded before I went offline on the project connect page?

Yes, that will be it. Usually we load the project profile rather than the project, as you only really need the project doc if you want the paratextUsers property.

@pmachapman pmachapman added ready to test and removed will require testing PR should not be merged until testers confirm testing is complete labels Jan 21, 2025
@siltomato siltomato force-pushed the fix/sf-2860-offline-project-connect-error branch from 9a75a12 to 4c2eeb0 Compare January 22, 2025 22:24
@Nateowami Nateowami force-pushed the fix/sf-2860-offline-project-connect-error branch from 4c2eeb0 to f49f42a Compare January 23, 2025 16:39
@Nateowami Nateowami added testing complete Testing of PR is complete and should no longer hold up merging of the PR and removed ready to test labels Jan 23, 2025
@Nateowami Nateowami force-pushed the fix/sf-2860-offline-project-connect-error branch from f49f42a to 7259515 Compare January 23, 2025 17:42
@Nateowami Nateowami enabled auto-merge (squash) January 23, 2025 17:48
@Nateowami Nateowami merged commit bc4e30e into master Jan 23, 2025
14 of 15 checks passed
@Nateowami Nateowami deleted the fix/sf-2860-offline-project-connect-error branch January 23, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working testing complete Testing of PR is complete and should no longer hold up merging of the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants