From 2e21a0c4bc673ac5efbf279dda98939ab52bdf49 Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Fri, 20 Nov 2026 15:19:25 +0700 Subject: [PATCH] Tell Mac FW Lite users when an update is out Lexbox now serves the Mac DMG from the release feed (download-latest and should-update with edition=mac), and the Mac app checks that feed like Linux does. It can't install the update itself, so it shows the existing "A new version is available" toast with a Download button. Co-Authored-By: Claude Opus 5.5 --- .../AppUpdate/UpdateCheckerTests.cs | 15 ++++++++------- .../FwLiteShared/AppUpdate/UpdateChecker.cs | 9 +++++---- .../FwLiteReleases/FwLiteReleaseService.cs | 2 +- backend/LexBoxApi/appsettings.json | 4 ++++ .../LexCore/Services/FwLiteReleaseServiceTests.cs | 5 +++-- docs/site/fw-lite/faq.md | 9 ++++++--- 6 files changed, 27 insertions(+), 17 deletions(-) diff --git a/backend/FwLite/FwLiteShared.Tests/AppUpdate/UpdateCheckerTests.cs b/backend/FwLite/FwLiteShared.Tests/AppUpdate/UpdateCheckerTests.cs index 4d3fdff7cc..016e53a66a 100644 --- a/backend/FwLite/FwLiteShared.Tests/AppUpdate/UpdateCheckerTests.cs +++ b/backend/FwLite/FwLiteShared.Tests/AppUpdate/UpdateCheckerTests.cs @@ -42,11 +42,10 @@ private UpdateChecker CreateUpdateChecker(FwLiteConfig? config = null) [Theory] [InlineData(FwLitePlatform.iOS)] - [InlineData(FwLitePlatform.Mac)] [InlineData(FwLitePlatform.Android)] public void ShouldCheckReleaseFeed_WhenStoreDistributedPlatform_ReturnsFalse(FwLitePlatform os) { - //iOS/Mac have no GitHub release feed and Android is Play-driven; the feed round-trip is pointless. + //iOS has no GitHub release feed and Android is Play-driven; the feed round-trip is pointless. //Preferences are empty (never checked), so the throttle would otherwise allow the check - this //proves the platform skip wins for the default OnInterval condition. var config = new FwLiteConfig { UpdateCheckCondition = UpdateCheckCondition.OnInterval, Os = os }; @@ -57,7 +56,6 @@ public void ShouldCheckReleaseFeed_WhenStoreDistributedPlatform_ReturnsFalse(FwL [Theory] [InlineData(FwLitePlatform.iOS)] - [InlineData(FwLitePlatform.Mac)] [InlineData(FwLitePlatform.Android)] public void ShouldCheckReleaseFeed_WhenAlwaysConfigured_OverridesStoreDistributedSkip(FwLitePlatform os) { @@ -68,11 +66,14 @@ public void ShouldCheckReleaseFeed_WhenAlwaysConfigured_OverridesStoreDistribute checker.ShouldCheckReleaseFeed().Should().BeTrue(); } - [Fact] - public void ShouldCheckReleaseFeed_WhenNonStorePlatform_DelegatesToThrottle() + [Theory] + [InlineData(FwLitePlatform.Windows)] + [InlineData(FwLitePlatform.Linux)] + [InlineData(FwLitePlatform.Mac)] + public void ShouldCheckReleaseFeed_WhenNonStorePlatform_DelegatesToThrottle(FwLitePlatform os) { - //Windows uses the feed; with an empty last-check the throttle allows the check. - var config = new FwLiteConfig { UpdateCheckCondition = UpdateCheckCondition.OnInterval, Os = FwLitePlatform.Windows }; + //These use the feed; with an empty last-check the throttle allows the check. + var config = new FwLiteConfig { UpdateCheckCondition = UpdateCheckCondition.OnInterval, Os = os }; var checker = CreateUpdateChecker(config); checker.ShouldCheckReleaseFeed().Should().BeTrue(); diff --git a/backend/FwLite/FwLiteShared/AppUpdate/UpdateChecker.cs b/backend/FwLite/FwLiteShared/AppUpdate/UpdateChecker.cs index e30b05765f..d7fa766f5f 100644 --- a/backend/FwLite/FwLiteShared/AppUpdate/UpdateChecker.cs +++ b/backend/FwLite/FwLiteShared/AppUpdate/UpdateChecker.cs @@ -91,14 +91,15 @@ private void NotifyResult(UpdateResult result, FwLiteRelease release) /// /// Whether to check the GitHub release feed now: the shared interval gate /// () plus a skip for store-distributed - /// platforms. iOS/Mac have no release feed at all, and Android is driven by Google Play's in-app - /// updates (AndroidInAppUpdateService) instead of this check. The explicit Always condition - /// still forces a feed check for on-device endpoint testing. + /// platforms. iOS has no release feed at all, and Android is driven by Google Play's in-app + /// updates (AndroidInAppUpdateService) instead of this check. Mac uses the feed like Linux: it can't + /// install the update itself, so the user gets a Download prompt for the DMG. The explicit + /// Always condition still forces a feed check for on-device endpoint testing. /// internal bool ShouldCheckReleaseFeed() { if (config.Value.UpdateCheckCondition != UpdateCheckCondition.Always && - config.Value.Os is FwLitePlatform.iOS or FwLitePlatform.Mac or FwLitePlatform.Android) + config.Value.Os is FwLitePlatform.iOS or FwLitePlatform.Android) { logger.LogInformation("Update check skipped: {Os} updates are store/Play-driven, not via the release feed", config.Value.Os); diff --git a/backend/LexBoxApi/Services/FwLiteReleases/FwLiteReleaseService.cs b/backend/LexBoxApi/Services/FwLiteReleases/FwLiteReleaseService.cs index fbe9c662d9..fad2b0d4cb 100644 --- a/backend/LexBoxApi/Services/FwLiteReleases/FwLiteReleaseService.cs +++ b/backend/LexBoxApi/Services/FwLiteReleases/FwLiteReleaseService.cs @@ -44,7 +44,7 @@ public async ValueTask InvalidateReleaseCache() var editionConfig = config.Value.Editions.GetValueOrDefault(edition); if (editionConfig is null) { - //Editions with no release-asset config (e.g. store-distributed iOS/Mac) have no GitHub + //Editions with no release-asset config (e.g. store-distributed iOS) have no GitHub //feed to check. Return null ("no update") rather than throwing, which the endpoint would //otherwise surface as a 500 on every client launch. return null; diff --git a/backend/LexBoxApi/appsettings.json b/backend/LexBoxApi/appsettings.json index 993aff24d9..6c1931c9dc 100644 --- a/backend/LexBoxApi/appsettings.json +++ b/backend/LexBoxApi/appsettings.json @@ -88,6 +88,10 @@ }, "Android": { "FileNameRegex": "(?i)\\.apk$" + }, + "Mac": { + // the notarized Mac Catalyst build, FieldWorksLite.dmg + "FileNameRegex": "(?i)\\.dmg$" } } }, diff --git a/backend/Testing/LexCore/Services/FwLiteReleaseServiceTests.cs b/backend/Testing/LexCore/Services/FwLiteReleaseServiceTests.cs index 74620a0899..f192854c23 100644 --- a/backend/Testing/LexCore/Services/FwLiteReleaseServiceTests.cs +++ b/backend/Testing/LexCore/Services/FwLiteReleaseServiceTests.cs @@ -33,6 +33,7 @@ public FwLiteReleaseServiceTests() { config.Editions.Add(FwLiteEdition.Windows, new FwLiteEditionConfig() { FileNameRegex = "(?i)\\.msixbundle$" }); config.Editions.Add(FwLiteEdition.Linux, new FwLiteEditionConfig() { FileNameRegex = "(?i)linux\\.zip$" }); + config.Editions.Add(FwLiteEdition.Mac, new FwLiteEditionConfig() { FileNameRegex = "(?i)\\.dmg$" }); }) .Services .AddHybridCache() @@ -44,6 +45,7 @@ public FwLiteReleaseServiceTests() [Theory] [InlineData(FwLiteEdition.Windows)] [InlineData(FwLiteEdition.Linux)] + [InlineData(FwLiteEdition.Mac)] public async Task CanGetLatestRelease(FwLiteEdition edition) { var latestRelease = await _fwLiteReleaseService.GetLatestRelease(edition); @@ -54,11 +56,10 @@ public async Task CanGetLatestRelease(FwLiteEdition edition) [Theory] [InlineData(FwLiteEdition.iOS)] - [InlineData(FwLiteEdition.Mac)] [InlineData(FwLiteEdition.Android)] public async Task UnconfiguredEditionReturnsNullInsteadOfThrowing(FwLiteEdition edition) { - //Editions with no release-asset config (only Windows + Linux are configured in this fixture) + //Editions with no release-asset config (only Windows, Linux and Mac are configured in this fixture) //must not throw: the should-update endpoint would otherwise 500 on every such client launch. var latestRelease = await _fwLiteReleaseService.GetLatestRelease(edition); latestRelease.Should().BeNull(); diff --git a/docs/site/fw-lite/faq.md b/docs/site/fw-lite/faq.md index a7a7f0100f..d18d6a70cc 100644 --- a/docs/site/fw-lite/faq.md +++ b/docs/site/fw-lite/faq.md @@ -39,10 +39,13 @@ Windows and Linux computers, and Android phones and tablets (from Google Play). same app on every device. There is no iPhone or iPad version yet. :::warning[Mac: early testers only] -A Mac version is available for people who want to try it early. It doesn't update itself -yet, and it is less tested than the other versions. To try it, download -`FieldWorksLite.dmg` from the **Assets** of the +A Mac version is available for people who want to try it early. It is less tested than the +other versions. To try it, download `FieldWorksLite.dmg` from the **Assets** of the [latest FieldWorks Lite release on GitHub](https://github.com/sillsdev/languageforge-lexbox/releases/latest). + +It doesn't install updates by itself. When a new version is out, it tells you and offers a +**Download** button. Open the downloaded file and drag FieldWorks Lite into Applications, +replacing the old one. Your projects stay on your Mac. ::: ## Is my work safe if my phone or computer breaks?