Skip to content

Conversation

@hb0
Copy link
Contributor

@hb0 hb0 commented Dec 9, 2025

The DiguralApi singleton was using lazy initialization for the Retrofit instance, which meant it was only created once with the initial baseUrl. When users changed the URL in settings, the new URL was stored but the cached Retrofit instance continued using the old URL until app restart.

Changes:

  • Convert baseUrl from lateinit var to custom property with getter/setter
  • Add invalidation logic that clears cached Retrofit instances when URL changes
  • Replace lazy initialization with nullable backing fields that recreate on demand
  • Add debug logging when baseUrl changes to aid troubleshooting

This ensures the new URL takes effect immediately when changed in settings, whether during an active capture session or between sessions.

@hb0 hb0 self-assigned this Dec 9, 2025
The DiguralApi singleton was using lazy initialization for the Retrofit
instance, which meant it was only created once with the initial baseUrl.
When users changed the URL in settings, the new URL was stored but the
cached Retrofit instance continued using the old URL until app restart.

Changes:
- Convert baseUrl from lateinit var to custom property with getter/setter
- Add invalidation logic that clears cached Retrofit instances when URL changes
- Replace lazy initialization with nullable backing fields that recreate on demand
- Add debug logging when baseUrl changes to aid troubleshooting

This ensures the new URL takes effect immediately when changed in settings,
whether during an active capture session or between sessions.
@hb0 hb0 force-pushed the task/LEIP-410_fix-digural-url-only-updated-after-app-restart branch from 8674bfe to 7e9f654 Compare December 9, 2025 10:24
@hb0 hb0 merged commit 35ad65f into main Dec 9, 2025
3 checks passed
@hb0 hb0 deleted the task/LEIP-410_fix-digural-url-only-updated-after-app-restart branch December 9, 2025 10:25
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