Skip to content

[Breaking] CacheClient ensure consistent return values for expires in.#128

Merged
niemyjski merged 13 commits intomainfrom
bugfix/ensure-consistent-expires-in
Jan 3, 2026
Merged

[Breaking] CacheClient ensure consistent return values for expires in.#128
niemyjski merged 13 commits intomainfrom
bugfix/ensure-consistent-expires-in

Conversation

@niemyjski
Copy link
Copy Markdown
Member

@@ -1,13 +1,10 @@
if math.modf(@value) == 0 then
local integral, fractional = math.modf(@value)
if fractional == 0 then
Copy link
Copy Markdown
Member Author

@niemyjski niemyjski Jan 1, 2026

Choose a reason for hiding this comment

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

we don't call this unless an expires is passed in, otherwise we just call StringIncrementAsync. Thus we could simplify

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

… strings preserves decimal precision for doubles
…e()) which fails on macOS when the hostname has a .local suffix

The issue was that the original script used [System.Net.Dns]::GetHostAddresses([System.Net.Dns]::GetHostName()) which fails on macOS when the hostname has a .local suffix (like Blake-Work-MBP.local). This is because .local domains use mDNS (multicast DNS/Bonjour) rather than regular DNS, and the .NET DNS resolver doesn't handle mDNS.
The fix uses [System.Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces() which:
Is a standard .NET API that works on Windows, macOS, and Linux
Directly queries network interfaces instead of relying on DNS resolution
Doesn't require try-catch since it's querying local system state
Filters for active, non-loopback interfaces with valid IPv4 addresses (excluding link-local 169.254.* addresses)
…tHostName()) which fails on macOS when the hostname has a .local suffix"

This reverts commit 7355c10.
Comment on lines +788 to +791
catch (Exception ex)
{
_logger.LogError(ex, "Error unsubscribing from topic {Topic}: {Message}", GetTopicName(), ex.Message);
}
@niemyjski niemyjski force-pushed the bugfix/ensure-consistent-expires-in branch from 16c0d5b to 64a5092 Compare January 3, 2026 15:42
@niemyjski niemyjski merged commit 406e8d5 into main Jan 3, 2026
2 of 4 checks passed
@niemyjski niemyjski deleted the bugfix/ensure-consistent-expires-in branch January 3, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants