Performance Optimizations — 4 Tasks - #1064
Merged
RUKAYAT-CODER merged 5 commits intoAug 27, 2026
Merged
Conversation
…sections Extract each visual section into its own React.memo component so a toggle in one section only repaints that section, not the entire screen. MobileSettings (619→91 lines) and SubscriptionManager (619→208 lines) are now thin orchestrators over memoised sub-components. Each section owns its own hooks and handlers. Accessibility labels added throughout. New files: - SettingRow.tsx, settingsIcons.tsx, settingsOptions.ts (shared primitives) - AccountSection, AppSection, PrivacySection, DownloadsSection, SyncSection, PerformanceSection, AccountActionsSection - subscription/: CurrentPlanCard, BillingToggle, PlanCard, FreePlanCard, RestoreFooter, subscriptionMeta 🤖 Generated with Codebuff Co-Authored-By: Codebuff <[email protected]>
Three independent paths detected or resolved sync conflicts:
1. syncService.ts — isConflictError, resolveConflicts, normalizeStrategy
2. axios.config.ts — inline 409 ConflictData construction
3. syncEntityManager — used by WebSocket path
Consolidated into:
- sync/httpConflictDetection.ts — single HTTP conflict detection entry
(isConflictError, buildConflictDataFromHttpError, extractConflictPayload)
- syncService.ts — delegates to syncEntityManager, removed duplicate
resolveConflicts/normalizeConflictStrategy/isConflictError
- axios.config.ts — delegates to httpConflictDetection utility
Updated docs/conflict-resolution-strategy.md to document the unified
architecture and added end-to-end tests for the HTTP detection path.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <[email protected]>
…ueue The request queue had deduplication via fingerprint (rinafcode#813) but no size bound — during extended offline periods a polling screen could enqueue the same GET repeatedly, and on reconnection all of them would replay. Changes: - MAX_QUEUE_SIZE (100) with oldest-first eviction by priority (critical requests are never evicted) - GET requests are collapsed: newer entry replaces older one so reconnection replays only the most recent read per endpoint - Dropped request counter (getDroppedCount) for observability - Eviction and dedup events logged for debugging - Extended test coverage for dedup, GET collapsing, eviction, and duplicate write prevention on reconnection - Updated docs/queue-priority-strategy.md 🤖 Generated with Codebuff Co-Authored-By: Codebuff <[email protected]>
Analytics events fired on high-frequency paths had no documented sampling policy — the hardcoded 10% rate was not aligned with event importance, and there was no session-level volume bound. Changes: - New samplingPolicy.ts: per-event frequency classification (critical/ high/medium/low), per-category sampling rates (100%/20%/10%/5%), documented high-frequency throttle rate, and session budget constant - MobileAnalyticsService: replaced hardcoded 10% sampling with the policy-based system, added droppedCount for observability - AnalyticsBatchQueue: enforce SESSION_EVENT_BUDGET (500 events/session), track and log budget exhaustion - Updated docs/PERFORMANCE_MONITORING.md with full sampling policy docs 🤖 Generated with Codebuff Co-Authored-By: Codebuff <[email protected]>
|
@m-hajjo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Thank you for contributing to the project. |
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.
Summary
This PR addresses four performance and code quality issues across the TeachLink Mobile codebase: component re-render waste, duplicate sync conflict logic, unbounded request queuing, and undocumented analytics sampling.
Closes #996
Closes #997
Closes #998
Closes #999