Skip to content

Optimization: shared session init - #8936

Merged
claudiux merged 1 commit into
linuxmint:masterfrom
kevinbouge:optimize-soup-session-handling
Aug 5, 2026
Merged

Optimization: shared session init#8936
claudiux merged 1 commit into
linuxmint:masterfrom
kevinbouge:optimize-soup-session-handling

Conversation

@kevinbouge

Copy link
Copy Markdown
Contributor

Fixes

  1. Shared Session Initialization: Added a single, persistent Soup.Session instance (this._httpSession) in the constructor of AirAwareApplet. This ensures connection pooling (HTTP Keep-Alive) is reused across multiple refreshes, reducing connection latency and memory allocation overhead.
  2. Proper Cleanup: Handled cleanup by calling this._httpSession.abort() inside the _destroy() method of applet.js. This guarantees that if the applet is removed or reloaded, any active requests on the session are immediately aborted, preventing memory leaks or orphaned callbacks.
  3. Session Propagation: Updated the calls to all asynchronous providers (Open-Meteo Air Quality, Open-Meteo Weather, OpenStreetMap Vegetation, and Nominatim Reverse Geocoder) to pass the shared this._httpSession instead of letting them instantiate their own temporary sessions.

Tested
./validate-spice airaware@kevinbouge
./test-spice airaware@kevinbouge
./cinnamon-spices-makepot airaware@kevinbouge
airaware@kevinbouge/tests/run-tests.sh
Local Cinnamon panel testing

@claudiux
claudiux merged commit 6fd67b3 into linuxmint:master Aug 5, 2026
4 checks passed
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