• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

GeorgeSG / KoInsight / 20678279360
55%

Build:
DEFAULT BRANCH: master
Ran 03 Jan 2026 02:03PM UTC
Jobs 1
Files 35
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Jan 2026 02:02PM UTC coverage: 44.192%. Remained the same
20678279360

push

github

web-flow
Aggressive sync on suspend (#66)

Credits to @cykirk and https://github.com/GeorgeSG/KoInsight/pull/57 for inspiration, this PR is basically based on this work.

This implements an aggressive sync mode that automatically manages WiFi connectivity during device suspend events, allowing KoInsight to sync even when WiFi is disabled. Additionally, it refactors settings management into a centralized, maintainable architecture.

### Features added

1. Aggressive sync mode workflow
- Automatically turns on WiFi when device suspends (if disabled)
- Waits for network connection with configurable timeout (3-60 seconds, default: 10s)
- Performs sync operation
- Restores original WiFi state after sync completes
- Includes error handling with automatic WiFi cleanup on failure

2. Edit menu structure
- Added "Sync on suspend" toggle (master switch for suspend sync functionality)
- Added "Aggressive sync on suspend (auto Wi-Fi)" toggle (enables WiFi management)
- Added "Set suspend connect timeout" dialog (configures WiFi connection wait time, I think depending on users WiFi and especially eReader device, this might be a viable setting)

3. Refactor settings
- Centralized all settings management in `settings.lua`
- Implemented robust getter/setter pattern
- Added `update()` method as single write path for all settings
- Moved settings logic from `main.lua` to `settings.lua`

### Technical details

Settings managed:
- `server_url` - KoInsight server endpoint
- `sync_on_suspend` - Master toggle for suspend sync (default: true)
- `aggressive_suspend_sync` - WiFi auto-management toggle (default: false)
- `suspend_connect_timeout_s` - WiFi connection timeout in seconds (default: 10, range: 3-60)

Sync pathways:
- **Normal mode**: Only syncs if WiFi is already connected (existing behavior)
- **Aggressive mode**: Manages WiFi state, turns on if needed, syncs, restores original state

Event handlers:
Use the following events: `onSuspend`, `onPowerOff`, `onReboot`. NOT use `... (continued)

112 of 128 branches covered (87.5%)

Branch coverage included in aggregate %.

531 of 1327 relevant lines covered (40.02%)

9.58 hits per line

Jobs
ID Job ID Ran Files Coverage
1 20678279360.1 03 Jan 2026 02:03PM UTC 35
44.19
GitHub Action Run
Source Files on build 20678279360
  • Tree
  • List 35
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #20678279360
  • 42f8f3b7 on github
  • Prev Build on master (#18616941296)
  • Next Build on master (#20678283895)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc