Skip to content

Commit

Permalink
Improved the _checkLicense() code to prevent cases where we falsely d…
Browse files Browse the repository at this point in the history
…ecided that the license key is definitely invalid and that we don't need to fallback to the cache. Now we have much better code that explicitly encodes whether the server told us that the license is *definitively* valid or invalid, or if the server's response does not indicate for sure whether a license is valid or not. And then we fall back to the cache whenever the server's response is not clear. This might fix issues such as #1136. I reviewed these changes pretty meticulously, but still might have introduced bugs, since we changed the logic pretty substantially.
  • Loading branch information
noah-nuebling committed Oct 9, 2024
1 parent 1113b33 commit 4d24927
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 85 deletions.
2 changes: 1 addition & 1 deletion App/SupportFiles/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>22966</string>
<string>22970</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>NSHumanReadableCopyright</key>
Expand Down
2 changes: 1 addition & 1 deletion Helper/SupportFiles/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>22966</string>
<string>22970</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSBackgroundOnly</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,38 +310,6 @@
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "F9B818D3-960C-4B07-B581-0AAEDA60AF4F"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Shared/License/License.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "351"
endingLineNumber = "351"
landmarkName = "_checkLicense(key:licenseConfig:incrementUsageCount:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "911C0E9B-27C8-47D6-8FBD-0AEA1574776B"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Shared/License/License.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "341"
endingLineNumber = "341"
landmarkName = "_checkLicense(key:licenseConfig:incrementUsageCount:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
Expand Down Expand Up @@ -646,5 +614,37 @@
landmarkType = "9">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "93800C00-1F61-4FA2-AE77-A519FA394622"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Shared/License/License.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "285"
endingLineNumber = "285"
landmarkName = "_checkLicense(key:licenseConfig:incrementUsageCount:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "A051292D-2020-4FBA-8E58-706FD978D097"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Shared/License/License.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "284"
endingLineNumber = "284"
landmarkName = "_checkLicense(key:licenseConfig:incrementUsageCount:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Loading

0 comments on commit 4d24927

Please sign in to comment.