Spaces:
Running
Running
Commit History
Today
-
security(cfskill-run3): deep audit fixes + SonarCloud quality pass
Z UserAudit (cloudflare/security-audit-skill, 7 coverage units, 5 hunter waves): - cache: Redis delPattern prefix->glob — settings/approval-gate invalidation was a silent no-op under Redis (stale contact info + delayed gate close) - jwt/approval: remove hardcoded dev APP_SECRET fallback (public repo secret) - boot: production fatal log when EDGE_HOST_ENFORCE unset (fail-loud) - yt-sync: GET /state now bound to x-sync-ts window (eternal replay lane gone) - paymob webhook: signed currency actually passed to verifyPaymobAmount; promo quota released on terminal FAILED events (+ idempotent re-consume when a later event completes the same order) - push: endpoint rows can no longer be re-bound/cross-deleted between users - sessions: bounded device-metadata strings (column widths) - notification links: protocol-relative URLs rejected; noopener unified; Paymob redirect pinned to accept.paymob.com - deploy.sh: secret gate covers re_/gsk_/nvapi-/modal-/mysql:// families SonarCloud (194 open ->…700d33c
2 days ago
-
fix(sonar): final three — real button toast card, lookup-map action verbs, awaited stream consumer
Z User- S6819/S6847/S6845: the actionable toast is now a REAL <button> card (native keyboard activation — no ARIA role, no double-fire Enter handler); announcements keep role=alert; dismiss is an absolutely-positioned sibling so no interactive element nests inside another - S3776: actionLabelFor complexity — verbs moved to a lookup map - S7785: the log-stream consumer is captured and top-level-awaited (raced with a bounded drain) instead of a discarded void call9a1fb7a -
fix(sonar): clean the 9 findings the deep-link commit surfaced on new code
Z User- S3776 (critical): NotificationPollerBridge event assembly split into flat helpers (announceApprovalRequest / actionLabelFor / toastDurationFor) - S3358: duration nested ternary extracted - S4624: push-sw link builder via concatenation (no nested templates) - S6594: RegExp.exec instead of String.match (notification-link + push-sw) - S7785: named async fn + void detach (no async IIFE) - S6847/S6845: actionable toast card gets role=button (interactive element may carry mouse/keyboard listeners + tabIndex); announcements keep alert - S6582: optional chain in the NOTIFICATION_CLICKED handlere70a195 -
feat(notifications): one-tap deep links — every actionable notification opens its action screen
Z UserOwner directive 2026-12-01: clicking a notification must OPEN the place its action happens on (e.g. a join request lands straight on the accept/reject queue), not just flip a read flag. Root fixes: - server: approval fan-out url /admin?tab=users (renders the DASHBOARD tab under path-based routing) -> /admin/users?approvals=1; email dashboardUrl fixed the same way; approval-accepted notice /login -> /dashboard - client: src/lib/notification-link.ts — one resolver for every event (scheme safety + legacy ?tab= normalization + structured-payload fallbacks so a join request can NEVER render link-less), fully unit-tested - toast: the CARD body is clickable now (onOpen + keyboard support), join requests get a 'مراجعة الطلب' action button and 12s dwell - bell rows normalize legacy persisted urls before opening; 'افتح' affordance - push-sw: notificationclick posts the SPA path form (absolute URLs were silently dropped by the page handler) + legacy url normalization - /admin/users?a…6da4d8e
8 days ago
-
chore(biome): eliminate the organizeImports class repo-wide + close every remaining biome error
Z UserThe three organizeImports errors documented on the avatar feature (review- router, CourseReviews, ChatBot) were one instance of a repo-wide class: 17 assist/source/organizeImports diagnostics across 15 files, all on untouched import blocks. biome check --write applied the safe mechanical reorder (no side-effect-only imports moved — verified against the full diff; the 1391-test suite + tsc + build all pass unchanged). Also closed so `npx biome check .` now exits clean: - email-templates.ts useTemplate: concat → template literal - chatbot-cables-kb.ts noApproximativeNumericConstant ×2: biome-ignore with justification — ac 1.442 Ω/km is measured IEC cable data, NOT the log2(e) constant the rule suspects; auto-fix would have corrupted the table - admin-learning.ts usePlaywrightValidDescribeCallback ×3: biome-ignore — `describe` there is the local error formatter (line 238) for the DB canary diagnostics, not a test-runner describe18afd52
9 days ago
-
feat(approval): admin gate on registration — owner approves/rejects every join before login
ahmdelbaz28-uxOwner directive (2026-11-24): 'أنا كأدمن لازم أقبل أو أرفض أي حد يسجل في المنصة قبل ما يدخل — وعندي سلطة إلغاء دخول أي حد في أي وقت.' SERVER (enforced at EVERY session-issuance path): - users.approvalStatus (pending|approved|rejected) + decision columns, v17 idempotent migration — DEFAULT 'approved' grandfathers all pre-gate accounts with zero backfill; registration writes 'pending'. - register: creates the account pending, issues NO token/cookie, responds pendingApproval:true — the login gate enforces the rest. - login: gate AFTER credential+2FA verify, BEFORE session issuance — correct credentials are not enough. Stable APPROVAL_PENDING / APPROVAL_REJECTED sentinels drive the localized panels; pending retries never burn the per-account failure throttle. - Google OAuth callback + GIS: all paths gated; new Google sign-ups insert pending and receive NO session (redirect marker / 403 codes). - decideApproval: reject flips status AND bumps tokenVersion in ONE UPDATE (live…a7cb154
22 days ago
-
security(audit-run1): 7 confirmed findings fixed + chatbot architecture fixes
Z UserSecurity audit run-1 (Cloudflare security-audit-skill, 6 phases, 34 coverage units, 13 independently verified findings) + agent-architecture-audit (12-layer chatbot stack). Shipped fixes: - native-client-detection-token-disclosure (medium): token-source binding — x-renewed-token only for header-sourced tokens; body JWT requires capacitor header AND no auth cookie - promo.leftmost-xff-quota-key (medium): trust-ordered client IP for all three promo throttles; validate probe keyed userId+resolved IP - promo.usage-cap.check-then-act-race (hardening): SELECT ... FOR UPDATE on promoCodes row serializes cap checks inside the payment transaction - ai-router SSRF guard: IPv4-mapped/translated IPv6 decoded to dotted quad before range checks; NAT64 + embedded-IPv4 rejected; redirect:'error' on all key-bearing provider fetches - push-subscription SSRF: push-service host allowlist (subscribe + send time), per-user subscription cap (10), legacy-row healing - ai-diagnostics egress: no …b9b9643
-
chore(quality): close all SonarCloud findings in notification stack + biome/hadolint clean
Z UserApplied 4 audited skills end-to-end (triage-vulnerabilities, sonarqube-audit, lint-all, agent-browser). Results: - SonarCloud: all 29 open findings in authored files fixed (S3776 x3 CRITICAL complexity, S4123 real await-precedence bug, S9382 x3 parallelized fan-out/cleanup, S3358/S4043/S4624/S5869/S7780/ S7785/S3735/S5906, python S7632/S1192/S1172/S1186) - lint-all: tsc + ultracheck + eslint + biome + hadolint all exit 0 - vulnerabilities: prod deps 0; deepmerge GHSA low = dev-only, no upstream patch (report-only, forced downgrade rejected) - agent-browser live check: SW activated+controlling, push-sw.js wired, PushManager available, zero console errors on prod build - gates: vitest 344/344, build PWA v1.3.0 51 precache44816d6 -
feat(notifications): persistent broadcast system + YouTube episode watcher
Z User- notifications MySQL table (v11, broadcast rows stored once, survive restarts, visible to users who register later) + Drizzle schema export - api/lib/notification-broadcast.ts: pushNotification (never throws), recentBroadcasts/userNotifications, 30-day prune - api/lib/youtube-watcher.ts: polls the ETAP playlist every 15 min (page HTML primary — works with unlisted uploads; RSS fallback), silent state init, max 3 announcements/tick, state persisted in siteSettings - api/lib/notification-utils.ts: pure feed parsers (legacy renderer + 2025+ lockupViewModel layouts) with 14 unit tests - Hono GET /api/notifications/poll: merges DB broadcasts + legacy cache events, cursor-based, per-user 10s throttle, guests get quiet empty responses - Content hooks: createLesson / references create / software create broadcast to all registered users (fire-and-forget) - admin.sendBroadcast tRPC mutation + new Admin > Notifications tab wiring the previously dead AdminNotificationPanel to real…e83899c