Skip to content

Improve app and tunnel initialization#1376

Merged
keeshux merged 3 commits into
masterfrom
bugfix/context-leftovers
May 19, 2025
Merged

Improve app and tunnel initialization#1376
keeshux merged 3 commits into
masterfrom
bugfix/context-leftovers

Conversation

@keeshux

@keeshux keeshux commented May 16, 2025

Copy link
Copy Markdown
Member

First, refactor Partout to use PartoutLogger[Context]. Then, simplify the lifecycle of bootstrap entities in a predictable way. Basically, move the initialization of the app to AppDelegate, and the tunnel initialization to PacketTunnelProvider. PartoutLogger is configured the earliest.

To do this:

  • Make AppContext (production) non-static with a convenience init(), so that its lifecycle and input is predictable
  • Move TunnelContext code to PacketTunnelProvider, as it's only used there
  • Move CommonLibrary/UILibrary classes' logic to AppDelegate and PacketTunnelProvider
  • Expose the initialization of KeyValueManager to spot app/shared preferences
  • Wrap shared preferences in AppPreferenceValues

These fixes must keep the current .appex functionality, so restore the "Logs private data" preference.

For .sysex (Developer ID), #1373, #1374, and #1375 need to be fixed as well.

@keeshux keeshux self-assigned this May 16, 2025
@keeshux keeshux added regression Used to work but doesn't anymore refactoring Improves software architecture labels May 16, 2025
@keeshux keeshux added this to the 3.4.0 milestone May 16, 2025
@keeshux keeshux moved this to In Progress in 2025 Q2-Q4 Scaling May 16, 2025
@keeshux keeshux marked this pull request as draft May 17, 2025 17:19
First, refactor Partout to use PartoutLogger[Context].

Simplify the lifecycle of bootstrap entities. Basically, move the
initialization of the app to AppDelegate, and the tunnel's to
PacketTunnelProvider. PartoutLogger is created the earliest.

To do this:

- Make AppContext (production) non-static with a convenience init()
- Move TunnelContext code to PacketTunnelProvider, only used there
- Move CommonLibrary/UILibrary classes logic to AppDelegate
@keeshux keeshux force-pushed the bugfix/context-leftovers branch from fa559cc to f508bcd Compare May 19, 2025 16:22
@keeshux keeshux changed the title Polish some PartoutContext leftovers Improve app and tunnel initialization May 19, 2025
@keeshux keeshux marked this pull request as ready for review May 19, 2025 16:40
@keeshux keeshux merged commit f274406 into master May 19, 2025
1 check passed
@keeshux keeshux deleted the bugfix/context-leftovers branch May 19, 2025 16:42
@keeshux keeshux moved this from In Progress to Done in 2025 Q2-Q4 Scaling May 19, 2025
keeshux added a commit that referenced this pull request May 20, 2025
Currently false, must default to true. Also, add missing fallback logic
to shortcut methods of KeyValueManager.

Regression in #1376
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Improves software architecture regression Used to work but doesn't anymore

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant