Skip to content

Conversation

RaymondLuong3
Copy link
Collaborator

@RaymondLuong3 RaymondLuong3 commented Sep 9, 2025

Adding a draft to a book that is empty fails to create the missing chapters. We needed a way to detect how many chapters exist in the generated draft and notify the front end so that it can create the missing chapters and update the project texts property. This PR creates a new endpoint that can be used to get the chapters that have drafts.


This change is Reviewable

@RaymondLuong3 RaymondLuong3 added the will require testing PR should not be merged until testers confirm testing is complete label Sep 9, 2025
Copy link

codecov bot commented Sep 9, 2025

⚠️ File not in storage

No result to display due to the CLI not being able to find the file.
Please ensure the file contains junit in the name and automated file search is enabled,
or the desired file specified by the file and search_dir arguments of the CLI.

Comment on lines +1178 to +1183
SFProject project = await EnsureProjectPermissionAsync(
curUserId,
sfProjectId,
isServalAdmin: false,
cancellationToken
);

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This assignment to
project
is useless, since its value is never read.

Copilot Autofix

AI 3 days ago

To fix the problem, simply remove the assignment to the project variable and instead await the method directly as a statement. In src/SIL.XForge.Scripture/Services/MachineApiService.cs, replace SFProject project = await EnsureProjectPermissionAsync(...); with await EnsureProjectPermissionAsync(...);. No further code changes are required since the result is never used. No changes to imports, method signatures, or additional definitions are needed.


Suggested changeset 1
src/SIL.XForge.Scripture/Services/MachineApiService.cs

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/SIL.XForge.Scripture/Services/MachineApiService.cs b/src/SIL.XForge.Scripture/Services/MachineApiService.cs
--- a/src/SIL.XForge.Scripture/Services/MachineApiService.cs
+++ b/src/SIL.XForge.Scripture/Services/MachineApiService.cs
@@ -1175,7 +1175,7 @@
     )
     {
         // Ensure that the user has permission
-        SFProject project = await EnsureProjectPermissionAsync(
+        await EnsureProjectPermissionAsync(
             curUserId,
             sfProjectId,
             isServalAdmin: false,
EOF
@@ -1175,7 +1175,7 @@
)
{
// Ensure that the user has permission
SFProject project = await EnsureProjectPermissionAsync(
await EnsureProjectPermissionAsync(
curUserId,
sfProjectId,
isServalAdmin: false,
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
will require testing PR should not be merged until testers confirm testing is complete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant