feat(sensors): on-demand tüketicileri Orientation Sensor Gate'e taşı (PR 2/3)#57
Merged
selimmujdeci merged 1 commit intoJul 11, 2026
Merged
Conversation
…(PR 2/3) Yaşam-döngüsüyle açılıp kapanan dört sensör tüketicisini ham window.addEventListener yerine Orientation Sensor Gate (#40) üzerinden çalıştırır. Her tüketici gate release'ini kendi lifecycle alanında tutar; start/stop idempotent, duplicate acquire yok, gate'in sahibi değil. Taşınanlar: - arAlignmentService: deviceorientationabsolute+deviceorientation+ devicemotion → subscribeOrientationAbsolute/subscribeOrientation/ subscribeMotion (3 release ref; capture-fazı kaldırıldı — pencere-hedefli device event teslimatı faz-bağımsız, davranış değişmez) - dashcamService: devicemotion → subscribeMotion (_motionRelease) - blackBoxService._startAccelerometer: gate release aynen döner (_accelUnsub sözleşmesi değişmez) - deviceApi.subscribeToAccelerometer: gate release döner (sentryEngine _unsubAccel yolu değişmez) Davranış korundu: handler'lar/callback sırası/işaretleri/smoothing/ permission (feature-detect korundu, iOS requestPermission eklenmedi) aynı; event payload aynı callback'e ulaşır. Tüketiciler kendi visibilitychange listener'ını EKLEMEZ (gate yönetir). Event başına yeni allocation yok, yeni timer/rAF/polling yok, yeni bağımlılık yok, import yan etkisiz. Kazanım: aynı ham event için tek gate listener + background pause + temiz ownership.⚠️ gpsService ve smartDrivingEngine DEĞİŞMEDİ (hâlâ always-on) → Settings'te native sensör kaydı ve native 60 Hz DEVAM EDEBİLİR; bu PR native samplingPeriod düşüşü İDDİA ETMEZ, Settings CPU'yu ÇÖZMEZ (PR 3). Test: 30 migrasyon testi (gate acquire/release, tek fiziksel listener, visibility, event geçişi, gps/smartDriving değişmedi kilidi). tsc -b temiz · ESLint temiz · tam suite 3174 yeşil · prod build OK. Ledger #41 🔴 (Mali-400 bekliyor). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KKAPmfBwMTjsd5ft26GmXf
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
selimmujdeci
pushed a commit
that referenced
this pull request
Jul 12, 2026
… cihaz bekliyor Bracket->dot + release scan guard host-dogrulandi (CI yesil); taze APK'da eski anahtar yoklugu + BYOK akisi cihazda dogrulanmali. Provider rotate manuel adim. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0141GKY1eQru4Ap1PWN4VVst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Amaç
Orientation Sensor Gate 3-PR sırasının 2. adımı. Yaşam-döngüsüyle açılıp kapanan dört sensör tüketicisini, doğrudan
windowevent aboneliği yerine Orientation Sensor Gate (#40) üzerinden çalıştırır.Taşınan tüketiciler
arAlignmentServicesubscribeOrientationAbsolute/subscribeOrientation/subscribeMotion(3 release ref)dashcamServicesubscribeMotion(_motionRelease)blackBoxService._startAccelerometer_accelUnsubsözleşmesi değişmez)deviceApi.subscribeToAccelerometer_unsubAccelyolu değişmez)Lifecycle / release modeli
Her tüketici gate release'ini kendi lifecycle alanında tutar;
start/stopidempotent (mevcut guard'lar korundu); duplicate acquire yok; stop/dispose'ta release çağrılır; tüketici gate'in sahibi değil, gate'i dispose etmez.Davranış koruması
'DeviceMotionEvent' in window) korundu, iOSrequestPermissioneklenmedi.arAlignmentcapture-fazı kaldırıldı — pencere-hedefli device event teslimatı faz-bağımsız, davranış değişmez.Visibility
Tüketiciler kendi
visibilitychangelistener'ını EKLEMEZ — gate merkezî olarak yönetir (çift listener yok). Background'da fiziksel listener gate tarafından sökülür; foreground'da yalnız aktif consumer geri bağlanır.Performans etkisi
Aynı ham event için birden fazla fiziksel JS listener yerine tek gate listener + background pause + temiz ownership. Event başına yeni allocation yok · yeni timer/rAF/polling yok · callback gövdesi büyümedi · yeni bağımlılık yok · import yan etkisiz.
gpsService ve smartDrivingEngine bu PR'da DEĞİŞMEDİ (hâlâ always-on). Bu yüzden:
Bunlar PR 3 kapsamıdır (always-on compass + smartDriving talep-güdümlü acquire + background pause).
Test & Doğrulama
gpsService/smartDrivingEnginedeğişmedi kilidi, permission korundu).tsc -b --noEmittemiz · ESLint temiz · tam suite 3174/3174 yeşil (regresyon yok) · prod build OK.Değişen dosyalar
platform/arAlignmentService.ts·platform/dashcamService.ts·platform/security/blackBoxService.ts·platform/deviceApi.ts·__tests__/orientationGateConsumerMigration.test.ts(yeni) ·docs/DEVICE_VALIDATION_LEDGER.md(#41 🔴)🤖 Generated with Claude Code