Skip to content

resolve a bunch of build warnings#1679

Merged
hahn-kev merged 1 commit into
developfrom
resolve-warnings-may-2025
May 22, 2025
Merged

resolve a bunch of build warnings#1679
hahn-kev merged 1 commit into
developfrom
resolve-warnings-may-2025

Conversation

@hahn-kev

Copy link
Copy Markdown
Collaborator

fixes various warnings, including ones about NHunspell which has been replace in newer versions of LCM.

upgrade the sqlite version to support 16kb page size
@coderabbitai

coderabbitai Bot commented May 20, 2025

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This update consists of code and configuration changes across multiple backend components. It includes dependency updates, constructor and method signature adjustments, improved API documentation through response type annotations, minor refactoring for naming consistency, removal of unused or obsolete code, and code simplifications such as converting asynchronous methods to synchronous ones where appropriate. Several exception handling patterns were also updated.

Changes

File(s) Change Summary
backend/Directory.Packages.props, backend/FwLite/LcmCrdt/LcmCrdt.csproj Updated and added package dependencies, including stable versions for icu.net, SIL.LCModel, and SQLitePCLRaw packages.
backend/FixFwData/Program.cs Renamed static fields and methods for consistent naming, and simplified property syntax.
backend/FwHeadless/Services/ProjectContextFromIdService.cs Removed a constructor dependency (CrdtProjectsService).
backend/FwLite/FwDataMiniLcmBridge.Tests/RichTextTests.cs Simplified array creation syntax in a test data method.
backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs Changed an async lambda to synchronous in UpdateWritingSystem.
backend/FwLite/FwDataMiniLcmBridge/FieldWorksProjectList.cs Removed default value from method parameter in explicit interface implementation.
backend/FwLite/FwLiteMaui/FwLiteMauiConfig.cs Simplified logic for determining the default data path.
backend/FwLite/FwLiteMaui/MauiProgram.cs Suppressed a specific compiler warning around a synchronous async dispose call.
backend/FwLite/FwLiteProjectSync/DryRunMiniLcmApi.cs Added a default case in a switch expression to throw on unknown enum values.
backend/FwLite/FwLiteShared/ExampleJsInterop.cs Removed the ExampleJsInterop class and its methods.
backend/FwLite/FwLiteShared/FwLiteShared.csproj Removed browser platform support declaration.
backend/FwLite/FwLiteShared/Layout/SvelteLayout.razor Changed DisposeAsync from async to synchronous returning a completed task.
backend/FwLite/FwLiteShared/Sync/BackgroundSyncService.cs Removed IMemoryCache dependency from the constructor and field default assignment.
backend/FwLite/FwLiteWeb/FwLiteWeb.csproj Removed the embedded files manifest generation property.
backend/FwLite/LcmCrdt/Changes/RemoveSemanticDomainChange.cs Changed an async method to synchronous, returning a completed task.
backend/FwLite/LcmCrdt/Data/SetupCollationInterceptor.cs Removed unused exception variable from a catch clause.
backend/FwLite/LcmCrdt/HistoryService.cs Suppressed a compiler warning for a LINQ condition.
backend/FwLite/LcmCrdt/RemoteSync/CrdtHttpSyncService.cs Changed an async method to synchronous, wrapping the result in a ValueTask.
backend/LexBoxApi/Auth/LoggedInContext.cs, backend/LexBoxApi/Jobs/LexJob.cs, backend/LexBoxApi/Services/EmailService.cs, backend/SyncReverseProxy/ProxyKernel.cs Replaced RecordException with AddException for exception recording on activities.
backend/LexBoxApi/Controllers/IntegrationController.cs, backend/LexBoxApi/Controllers/SyncController.cs, backend/LexBoxApi/Controllers/TestingController.cs Added or improved OpenAPI response type annotations for endpoints.
backend/LexBoxApi/GraphQL/CustomTypes/IsLanguageForgeProjectDataLoader.cs Suppressed a specific LINQ analyzer warning.
backend/LexBoxApi/Hub/CrdtProjectChangeHub.cs Removed a constructor parameter (LoggedInContext).
backend/LexBoxApi/Services/HgService.cs Added a default case to a switch expression for handling unexpected enum values.
backend/LexData/SeedingData.cs Removed logger dependency from the constructor.
backend/Testing/LexCore/Services/CrdtCommitServiceTests.cs Simplified a method by using ToAsyncEnumerable() instead of an async iterator.

Poem

In the garden of code, new seeds were sown,
Constructors trimmed, asyncs overthrown.
Dependencies updated, exceptions now neat,
With pragma and annotation, docs are complete.
Old wrappers retired, new enums in sight—
The rabbit hops onward, code shining bright!
🐇✨

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions

Copy link
Copy Markdown
Contributor

C# Unit Tests

116 tests  ±0   116 ✅ ±0   10s ⏱️ ±0s
 17 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 9b09dec. ± Comparison against base commit 7040f15.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (2)
backend/FixFwData/Program.cs (1)

43-45: ⚠️ Potential issue

Invalid Primary Constructor Syntax
The declaration private sealed class LoggingProgress(ILogger logger) : IProgress uses C# 12 primary constructor syntax, which may not be supported and will cause a compile error. Refactor to an explicit constructor and store the logger in a private field:

- private sealed class LoggingProgress(ILogger logger) : IProgress
+ private sealed class LoggingProgress : IProgress
  {
+     private readonly ILogger _logger;
+
+     public LoggingProgress(ILogger logger)
+     {
+         _logger = logger;
+     }
      public string Message { get => ""; set => logger.LogInformation(value); }

Then update Message to use _logger instead of logger.

backend/FwLite/FwLiteWeb/FwLiteWeb.csproj (1)

18-18: 💡 Verification agent

🧩 Analysis chain

Consider reviewing the need for FileProviders.Embedded package

The project still references Microsoft.Extensions.FileProviders.Embedded but no longer generates an embedded files manifest. If embedded resources are no longer used, consider also removing this package reference to maintain consistency.


🏁 Script executed:

#!/bin/bash
# Check if embedded resources are actually used in the project
grep -r "EmbeddedFileProvider\|GetManifestResourceNames\|GetManifestResourceStream" --include="*.cs" backend/FwLite/FwLiteWeb/

Length of output: 128


To ensure there really are no embedded resources being used, let’s check the project file for <EmbeddedResource> entries and look for any .resx files:


🏁 Script executed:

#!/bin/bash
echo "Checking for embedded resource entries in the project file..."
grep -Rni "<EmbeddedResource" backend/FwLite/FwLiteWeb/FwLiteWeb.csproj || echo "→ No <EmbeddedResource> entries found."

echo
echo "Looking for any .resx resource files in the Web project..."
find backend/FwLite/FwLiteWeb -type f -name "*.resx" || echo "→ No .resx files found."

Length of output: 483


Remove unused Embedded FileProviders package

The project no longer uses embedded resources—no <EmbeddedResource> entries, no .resx files, and no EmbeddedFileProvider usage were found. Remove the stale package reference:

• File: backend/FwLite/FwLiteWeb/FwLiteWeb.csproj

-    <PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" />
🧹 Nitpick comments (7)
backend/LexBoxApi/Controllers/IntegrationController.cs (1)

55-59: Consider documenting unauthorized responses
The endpoint is secured with [Authorize], so adding

[ProducesResponseType(StatusCodes.Status401Unauthorized)]

would make the OpenAPI spec more complete by explicitly capturing authentication failures.

backend/LexBoxApi/Controllers/TestingController.cs (1)

128-129: Add missing auth and default error response docs
Since this endpoint uses [AdminRequired], consider adding:

[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[ProducesDefaultResponseType]

to fully capture authentication, authorization, and unexpected errors in the OpenAPI schema.

backend/LexBoxApi/Controllers/SyncController.cs (1)

19-20: Unify attribute naming and document 403 responses
For consistency with other controllers, consider using the generic shorthand:

-[ProducesResponseTypeAttribute<ProjectSyncStatus>(StatusCodes.Status200OK)]
+[ProducesResponseType<ProjectSyncStatus>(StatusCodes.Status200OK)]

Also, since the method can return Forbid(), add:

[ProducesResponseType(StatusCodes.Status403Forbidden)]

to the annotations.

backend/FixFwData/Program.cs (2)

31-35: Ensure Thread-Safe Error Counting
If LogError may be invoked concurrently (e.g., from multiple threads), using plain writes and increments can lead to data races. Consider:

+ using System.Threading;
...
-    _errorsOccurred = true;
+    Volatile.Write(ref _errorsOccurred, true);
...
-    if (errorFixed)
-        ++_errorCount;
+    if (errorFixed)
+        Interlocked.Increment(ref _errorCount);

Also mark _errorsOccurred as private static volatile bool _errorsOccurred; for safe publication.


40-40: Adhere to C# Method Naming Conventions
The method getErrorCount should be renamed to GetErrorCount to follow PascalCase for private methods:

- private static int getErrorCount()
+ private static int GetErrorCount()

Also update its usage in Main.

backend/FwLite/FwLiteShared/FwLiteShared.csproj (1)

2-3: Consider removing the empty ItemGroup element.

This ItemGroup is now empty after removing the browser platform support. It can be safely removed to make the project file more concise.

<Project Sdk="Microsoft.NET.Sdk.Razor">
-  <ItemGroup>
-  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="BeaKona.AutoInterfaceGenerator" />
backend/FwLite/FwDataMiniLcmBridge/FieldWorksProjectList.cs (1)

40-43: Consider aligning parameter names between interface and implementation

There's an inconsistency between the parameter names: saveChangesOnDispose in the interface implementation versus saveOnDispose in the class's own method. While this isn't directly related to the current change, it could be worth standardizing these names in a future update to improve code clarity.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 7040f15 and 9b09dec.

📒 Files selected for processing (31)
  • backend/Directory.Packages.props (3 hunks)
  • backend/FixFwData/Program.cs (2 hunks)
  • backend/FwHeadless/Services/ProjectContextFromIdService.cs (1 hunks)
  • backend/FwLite/FwDataMiniLcmBridge.Tests/RichTextTests.cs (1 hunks)
  • backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs (1 hunks)
  • backend/FwLite/FwDataMiniLcmBridge/FieldWorksProjectList.cs (1 hunks)
  • backend/FwLite/FwLiteMaui/FwLiteMauiConfig.cs (1 hunks)
  • backend/FwLite/FwLiteMaui/MauiProgram.cs (1 hunks)
  • backend/FwLite/FwLiteProjectSync/DryRunMiniLcmApi.cs (1 hunks)
  • backend/FwLite/FwLiteShared/ExampleJsInterop.cs (0 hunks)
  • backend/FwLite/FwLiteShared/FwLiteShared.csproj (1 hunks)
  • backend/FwLite/FwLiteShared/Layout/SvelteLayout.razor (1 hunks)
  • backend/FwLite/FwLiteShared/Sync/BackgroundSyncService.cs (1 hunks)
  • backend/FwLite/FwLiteWeb/FwLiteWeb.csproj (1 hunks)
  • backend/FwLite/LcmCrdt/Changes/RemoveSemanticDomainChange.cs (1 hunks)
  • backend/FwLite/LcmCrdt/Data/SetupCollationInterceptor.cs (1 hunks)
  • backend/FwLite/LcmCrdt/HistoryService.cs (1 hunks)
  • backend/FwLite/LcmCrdt/LcmCrdt.csproj (1 hunks)
  • backend/FwLite/LcmCrdt/RemoteSync/CrdtHttpSyncService.cs (1 hunks)
  • backend/LexBoxApi/Auth/LoggedInContext.cs (1 hunks)
  • backend/LexBoxApi/Controllers/IntegrationController.cs (1 hunks)
  • backend/LexBoxApi/Controllers/SyncController.cs (1 hunks)
  • backend/LexBoxApi/Controllers/TestingController.cs (1 hunks)
  • backend/LexBoxApi/GraphQL/CustomTypes/IsLanguageForgeProjectDataLoader.cs (1 hunks)
  • backend/LexBoxApi/Hub/CrdtProjectChangeHub.cs (1 hunks)
  • backend/LexBoxApi/Jobs/LexJob.cs (1 hunks)
  • backend/LexBoxApi/Services/EmailService.cs (1 hunks)
  • backend/LexBoxApi/Services/HgService.cs (1 hunks)
  • backend/LexData/SeedingData.cs (0 hunks)
  • backend/SyncReverseProxy/ProxyKernel.cs (1 hunks)
  • backend/Testing/LexCore/Services/CrdtCommitServiceTests.cs (1 hunks)
💤 Files with no reviewable changes (2)
  • backend/LexData/SeedingData.cs
  • backend/FwLite/FwLiteShared/ExampleJsInterop.cs
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Build FwHeadless / publish-fw-headless
  • GitHub Check: Build API / publish-api
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Build FW Lite and run tests
  • GitHub Check: Analyze (csharp)
🔇 Additional comments (35)
backend/LexBoxApi/Controllers/IntegrationController.cs (1)

59-60: Explicit response annotations added
The new [ProducesResponseType(StatusCodes.Status404NotFound)] and [ProducesResponseType<RefreshResponse>(StatusCodes.Status200OK)] correctly document the possible HTTP responses for GetProjectToken.

backend/LexBoxApi/Controllers/TestingController.cs (1)

128-129: Response annotations for PreApproveOauthApp are in place
The added [ProducesResponseType(StatusCodes.Status404NotFound)] and [ProducesResponseType(StatusCodes.Status200OK)] accurately reflect the method’s 404 and 200 outcomes.

backend/LexBoxApi/Controllers/SyncController.cs (1)

19-20: Response annotations for GetSyncStatus look good
The attributes [ProducesResponseType(StatusCodes.Status404NotFound)] and [ProducesResponseTypeAttribute<ProjectSyncStatus>(StatusCodes.Status200OK)] correctly document the possible outcomes.

backend/FixFwData/Program.cs (5)

17-17: Static Logger Initialization
Assigning the created logger to the newly renamed _logger field looks correct.


19-20: Passing Delegates and Progress Implementation
Creating LoggingProgress with the _logger instance and passing the method group LogError and function getErrorCount aligns with the updated signatures. Ensure that FwDataFixer’s constructor parameters match this order and types.

Please verify that FwDataFixer accepts (string path, IProgress progress, Action<string,bool> logError, Func<int> getErrorCount).


22-22: Program Exit Code Logic
Returning 1 when any error occurred (_errorsOccurred == true) otherwise 0 correctly maps error states to exit codes.


25-27: Field Naming Consistency
Renaming the fields to _errorsOccurred, _errorCount, and _logger follows the underscore-prefixed private member convention. This is consistent and improves readability.


64-64: Expression-Bodied Property
Simplifying SynchronizeInvoke to an expression-bodied member returning null improves readability and removes boilerplate.

backend/LexBoxApi/Auth/LoggedInContext.cs (1)

24-24: LGTM - Standardized OpenTelemetry exception tracking.

This change correctly updates the exception tracking method from RecordException to AddException, aligning with modern OpenTelemetry practices and reducing build warnings.

backend/SyncReverseProxy/ProxyKernel.cs (1)

114-114: LGTM - Standardized OpenTelemetry exception tracking.

This change correctly updates the exception tracking method from RecordException to AddException, consistent with the updates in other files and reducing build warnings.

backend/LexBoxApi/Services/EmailService.cs (1)

245-245: LGTM - Standardized OpenTelemetry exception tracking.

This change correctly updates the exception tracking method from RecordException to AddException, consistent with the pattern applied throughout the codebase to reduce build warnings.

backend/LexBoxApi/GraphQL/CustomTypes/IsLanguageForgeProjectDataLoader.cs (1)

64-66: Warning suppression for MongoDB LINQ query is appropriate.

The addition of the pragma directives to suppress the MALinq2001 warning addresses a MongoDB LINQ provider issue with the Contains method within a LINQ query against MongoDB. While ideally we would rewrite the query to avoid the warning (possibly using a MongoDB-native approach), suppressing it is reasonable if the query works correctly in practice.

backend/LexBoxApi/Jobs/LexJob.cs (1)

58-58: Method updated to align with current OpenTelemetry API.

The change from RecordException to AddException aligns with the current OpenTelemetry API for recording exceptions on activity spans. This is a good update that maintains functionality while resolving build warnings.

backend/FwLite/FwLiteMaui/MauiProgram.cs (1)

24-26: Appropriate warning suppression for shutdown scenario.

The VSTHRD002 warning suppression is justified in this case. While synchronously waiting on async operations with .GetAwaiter().GetResult() can lead to deadlocks in UI contexts, this code runs in a dedicated shutdown thread where that risk is minimal. Since the code is only executed during app termination, this approach is acceptable.

backend/FwLite/LcmCrdt/HistoryService.cs (1)

93-95: Type safety warning suppression is reasonable.

The CS8073 warning occurs because the comparison to null for non-nullable value types will always yield the same result. While ideally the condition would be rewritten to eliminate the redundant check, suppressing the warning maintains code clarity without changing behavior.

backend/FwLite/FwLiteShared/Layout/SvelteLayout.razor (1)

85-87: Simplify to avoid async state machine overhead.

The method has been refactored to remove the async keyword and directly return ValueTask.CompletedTask, which eliminates unnecessary async state machine overhead for a method that doesn't perform any actual asynchronous work.

backend/FwLite/FwLiteMaui/FwLiteMauiConfig.cs (1)

13-13:

Details

✅ Verification successful

Simplify fallback path logic.

The fallback logic has been simplified by removing the intermediate fallback to Assembly.GetExecutingAssembly().Location and directly using "." as the fallback when Process.GetCurrentProcess().MainModule?.FileName is null.

Verify this change doesn't impact scenarios where the primary method returns null:


🏁 Script executed:

#!/bin/bash
# Check if there are any references to Assembly.GetExecutingAssembly().Location in the codebase
# that might be similarly affected by this change

rg -A 2 "Assembly.GetExecutingAssembly\(\).Location" --type cs

Length of output: 64


No remaining Assembly.GetExecutingAssembly().Location references; fallback simplified
I searched the repo for Assembly.GetExecutingAssembly().Location and found no occurrences. Consolidating the fallback to . when Process.GetCurrentProcess().MainModule?.FileName is null is safe.

backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs (1)

197-206: Optimize by removing unnecessary async state machine.

The lambda passed to Cache.DoUsingNewOrCurrentUOW has been changed from an asynchronous lambda to a synchronous one that returns a completed ValueTask. This eliminates the overhead of creating an async state machine when the lambda doesn't perform any actual asynchronous work.

backend/FwLite/FwDataMiniLcmBridge.Tests/RichTextTests.cs (1)

308-309: Simplify array creation syntax.

The code has been simplified to use compiler type inference (new[]) instead of explicitly typing the array as object?[]. This is a minor syntactic improvement that maintains the same functionality while making the code more concise.

backend/FwLite/FwLiteProjectSync/DryRunMiniLcmApi.cs (1)

37-38: Good addition of default case for exhaustive switch handling.

Adding a default case that throws a helpful exception for unknown writing system types improves robustness by ensuring explicit error handling when encountering unexpected enum values.

backend/LexBoxApi/Services/HgService.cs (1)

498-499: Good defensive programming with default case.

Adding a default case to the switch expression ensures that unexpected repository states are handled gracefully by treating them as empty, improving robustness.

backend/Testing/LexCore/Services/CrdtCommitServiceTests.cs (1)

57-60: Good simplification using ToAsyncEnumerable.

Simplified the AsAsync method by directly leveraging the built-in conversion from IEnumerable<T> to IAsyncEnumerable<T>. This eliminates unnecessary async state machine overhead.

backend/FwLite/LcmCrdt/RemoteSync/CrdtHttpSyncService.cs (1)

62-66: Performance improvement by avoiding unnecessary async state machine.

Changed the method from async to synchronous returning a ValueTask<ISyncable> directly. This eliminates the async state machine overhead while preserving the method's asynchronous signature.

backend/FwLite/FwDataMiniLcmBridge/FieldWorksProjectList.cs (1)

40-40: Good improvement to API clarity

Removing the default parameter value from the interface implementation is a positive change that requires callers to be explicit about the saveChangesOnDispose value. This helps prevent potential misunderstandings and aligns with best practices for interface implementations.

backend/FwLite/LcmCrdt/Data/SetupCollationInterceptor.cs (1)

32-32: Good cleanup: removed unused exception variable

Removing the unused exception variable eliminates a compiler warning while maintaining the same code behavior. This is a straightforward improvement that contributes to the PR's goal of resolving build warnings.

backend/FwLite/LcmCrdt/LcmCrdt.csproj (1)

21-24:

Details

✅ Verification successful

Appropriate SQLite dependencies added

Adding these SQLitePCLRaw packages properly integrates the SQLite native library support required by the application. This addresses build warnings related to missing dependencies and enables proper functionality of the SQLite database operations used in components like the SetupCollationInterceptor.


🏁 Script executed:

#!/bin/bash
# Verify these packages are properly versioned in the central package management file
grep -A 1 "SQLitePCLRaw" backend/Directory.Packages.props

Length of output: 438


Approve SQLitePCLRaw package additions

Verified that all four SQLitePCLRaw packages are pinned to version 2.1.11 in backend/Directory.Packages.props. These dependencies are required to resolve build warnings and enable SQLite functionality (e.g., in SetupCollationInterceptor).

  • backend/FwLite/LcmCrdt/LcmCrdt.csproj (lines 21–24)
  • backend/Directory.Packages.props (PackageVersion entries for SQLitePCLRaw.bundle_e_sqlite3, core, lib.e_sqlite3, provider.e_sqlite3)
backend/FwLite/FwLiteWeb/FwLiteWeb.csproj (1)

61-62: Appropriate removal of unused embedded files manifest generation

Removing the GenerateEmbeddedFilesManifest property is appropriate if the project doesn't require an embedded files manifest, eliminating unnecessary build steps and potential warnings.

backend/FwLite/FwLiteShared/Sync/BackgroundSyncService.cs (1)

19-19: Good cleanup: removed redundant initialization.

The explicit initialization of _running to false was removed, relying on the default value for boolean fields in C#. This is a good practice as it eliminates redundant code without changing behavior.

backend/Directory.Packages.props (3)

29-29: Upgrade to stable ICU.net version: Good improvement.

Upgrading from a beta version 3.0.0-beta.297 to the stable 3.0.1 release is a positive change that should improve stability.


102-103: Updated SIL.LCModel packages to newer beta versions.

Both SIL.LCModel packages were updated to the same beta version (11.0.0-beta0122), which ensures consistency between related packages.


106-109:

Details

✅ Verification successful

Added SQLitePCLRaw package references.

These SQLite-related packages are likely replacing NHunspell functionality mentioned in the PR objectives. This is an appropriate addition for supporting SQLite operations consistently across different platforms.


🏁 Script executed:

#!/bin/bash
# Check if these SQLite packages are referenced in the LcmCrdt project
grep -r "SQLitePCLRaw" --include="*.csproj" backend/FwLite/LcmCrdt/

Length of output: 466


Approve SQLitePCLRaw package central version management

The PackageVersion entries for SQLitePCLRaw (bundle_e_sqlite3, core, lib.e_sqlite3, provider.e_sqlite3) in backend/Directory.Packages.props (lines 106–109) are correctly picked up by backend/FwLite/LcmCrdt/LcmCrdt.csproj (via central package versioning). This centralizes version control and ensures consistent SQLite support across platforms.

backend/LexBoxApi/Hub/CrdtProjectChangeHub.cs (1)

8-8: Good dependency reduction: removed unnecessary LoggedInContext.

Simplifying the constructor by removing the unused LoggedInContext parameter reduces unnecessary dependencies. The hub still has all it needs through the IPermissionService to handle authorization checks in the ListenForProjectChanges method.

backend/FwHeadless/Services/ProjectContextFromIdService.cs (1)

8-8: Dependency cleanup: removed unused CrdtProjectsService.

Simplifying the constructor by removing the unused CrdtProjectsService parameter is good practice. The service doesn't appear to be using this dependency anywhere in its implementation, so removing it reduces unnecessary coupling.

backend/FwLite/LcmCrdt/Changes/RemoveSemanticDomainChange.cs (2)

12-15: Good refactoring of unnecessary async method.

The conversion from an async method to a synchronous one returning ValueTask.CompletedTask is a good optimization. This eliminates the unnecessary async state machine overhead while maintaining the same method signature, which helps resolve build warnings as intended by this PR.


14-14: Nice use of modern C# collection expression syntax.

The code uses C# 8.0+ collection expression syntax with the spread operator [..] to create a new collection from the filtered items, which is concise and readable.

@myieye myieye left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is great 👍

@hahn-kev hahn-kev merged commit ed1c581 into develop May 22, 2025
20 checks passed
@hahn-kev hahn-kev deleted the resolve-warnings-may-2025 branch May 22, 2025 03:54
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