Commit Graph

10 Commits

Author SHA1 Message Date
Doug Borg 2833906c68 Add centralized retry/fallback policy with hard-coded endpoints
Extract duplicated retry logic from OverpassService and RoutingService
into a shared resilience framework in service_policy.dart:

- ResiliencePolicy: configurable retries, backoff, and HTTP timeout
- executeWithFallback: retry loop with primary→fallback endpoint chain
- ErrorDisposition enum: abort / fallback / retry classification
- ServicePolicy + ServicePolicyResolver: per-service compliance rules
  (rate limits, caching, concurrency) for OSMF and third-party services
- ServiceRateLimiter: async semaphore-based concurrency and rate control

OverpassService now hits overpass.deflock.org first, falls back to
overpass-api.de. RoutingService hits api.dontgetflocked.com first,
falls back to alprwatch.org. Both use per-service error classifiers
to determine retry vs fallback vs abort behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 23:13:52 -06:00
Doug Borg 0137fd66aa Add consistent User-Agent header to all HTTP clients
Create UserAgentClient (http.BaseClient wrapper) that injects a
User-Agent header into every request, reading app name and version
from VersionService and contact/homepage from dev_config.dart.

Format follows OSM tile usage policy:
  DeFlock/<version> (+https://deflock.org; contact: admin@stopflock.com)

Replaces 4 inconsistent hardcoded UA strings and adds UA to the 9
call sites that previously sent none.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 19:31:27 -07:00
Doug Borg 5df0170344 Use out skel for Overpass way/relation pass and add service tests
Switch the second Overpass pass (ways/relations) from out meta to out skel,
dropping unused tags/version/changeset fields from the response. The app only
reads structural references (node lists, relation members) from these elements.

Also inject http.Client into OverpassService for testability (matching
RoutingService pattern) and add close() for client lifecycle management.

14 tests covering query building, constraint detection, and error handling.

Fixes #108

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 13:26:22 -07:00
stopflock 4a36c52982 Node fetch rework 2026-01-30 19:11:00 -06:00
stopflock 63675bd18a tbh not sure, left for a bit. sorry. pretty sure closer than last commit.. 2025-08-09 22:44:24 -05:00
stopflock dca6cb7179 bunch of stuff, good luck. still need to fix user-by-mode thing 2025-08-06 12:24:32 -05:00
stopflock dcdff6abbd profile filtering and submissions fixes 2025-08-05 17:30:55 -05:00
stopflock d3d1e4a7b2 added app2ipa script and I forget what the other changes were 2025-07-19 12:05:14 -05:00
stopflock f06894062f helps with load speed and number of connection refused messages 2025-07-18 15:40:49 -05:00
stopflock eee92f4f21 first version worth putting in git - compiles and runs - missing a lot still. 2025-07-18 14:25:22 -05:00