Skip to content

feat: Phase 28 Code Hygiene & Logging - #382

Merged
FSM1 merged 6 commits into
mainfrom
feat/phase-28-code-hygiene-logging
Mar 28, 2026
Merged

feat: Phase 28 Code Hygiene & Logging#382
FSM1 merged 6 commits into
mainfrom
feat/phase-28-code-hygiene-logging

Conversation

@FSM1

@FSM1 FSM1 commented Mar 28, 2026

Copy link
Copy Markdown
Owner

Summary

Phase 28: Code Hygiene & Logging
Goal: Production web app uses structured logging instead of raw console.* calls, unpin failures are visible, type safety gaps are closed, and legacy POC is archived
Status: Verified ✓

Created a structured logger module, replaced all raw console calls across the web app, made IPFS unpin failures visible, eliminated as any casts, and archived the legacy POC directory.

Changes

Plan 28-01: Structured Logger & Console Replacement

Created apps/web/src/lib/logger.ts with LogLevel enum (DEBUG/INFO/WARN/ERROR/SILENT), level filtering (production emits WARN+ only), and timestamped structured output. Replaced all 124 console.* calls across 28 web app source files.

Key files: apps/web/src/lib/logger.ts (new), 28 files modified across services/, hooks/, components/, lib/

Plan 28-02: Fix Silenced Unpin Failures

Replaced all 15 .catch(() => {}) patterns with .catch((err) => logger.warn(...)) so IPFS unpin failures are visible in logs. Also fixed the SDK client occurrence.

Key files: bin.service.ts, ReplaceFileDialog.tsx, AudioPlayerDialog.tsx, useDropUpload.ts, useFileVersions.ts, sdk/client.ts

Plan 28-03: Eliminate as any Casts

Replaced 4 polyfill as any casts with proper declare global type augmentations. Typed DEV-only window properties via interface extensions.

Key files: polyfills.ts, main.tsx, folder.store.ts

Plan 28-04: Archive Legacy POC

Removed 00-Preliminary-R&D/poc/ (8 files, 2527 lines, 89 MB committed node_modules). Created ARCHIVED.md with provenance.

Key files: 00-Preliminary-R&D/poc/ (deleted), 00-Preliminary-R&D/ARCHIVED.md (new)

Verification

  • Zero raw console.* calls in production web code (4 only inside logger.ts itself)
  • Zero .catch(() => {}) patterns on unpin calls
  • Zero as any casts in production web code
  • 00-Preliminary-R&D/poc/ removed

Key Decisions

  • Custom logger wrapper (~50 LOC) chosen over pino/browser — pino's redaction doesn't work in browser, Sentry integration is Node.js only
  • Logger includes transports hook array for Phase 30 (Grafana Faro) integration
  • Logger includes redact() interceptor stripping sensitive fields (privateKey, folderKey, etc.)
  • console.log mapped to logger.debug (suppressed in production)

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a structured, level-filtered logging system for improved error observability and debugging.
  • Bug Fixes

    • Converted previously silent error failures into logged warnings, improving visibility into operations like unpinning and promise handling.
  • Refactor

    • Removed unsafe type casts and added proper TypeScript type declarations for enhanced code safety.
  • Chores

    • Archived legacy proof-of-concept code while preserving full git history.

FSM1 and others added 5 commits March 28, 2026 04:22
Create lib/logger.ts with level-filtered output (debug/info/warn/error).
In production, only warn and error are emitted. Replace all 124 raw
console.* calls across 28 web app source files with logger equivalents.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All .catch with empty callbacks on IPFS unpin calls and AudioContext
close calls now log warnings via the structured logger so failures
are visible instead of silently swallowed. Also fixes the one
occurrence in packages/sdk/src/client.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace all `as any` casts in production web code with typed
alternatives. Polyfill globalThis augmentations use proper
declare-global blocks, the debug error log uses a typed Window
interface, and the Zustand debug store uses a typed window property.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove 00-Preliminary-R&D/poc/ which was superseded by the production
implementation. The POC code is preserved in git history. Add
ARCHIVED.md documenting what was removed and where to find it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Create plans, summaries, and verification for Phase 28. All 4 success
criteria verified: structured logger, visible unpin failures, no
as-any casts, POC archived. Update ROADMAP.md and STATE.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 28, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@FSM1 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 16 minutes and 26 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 16 minutes and 26 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6a52d25f-e664-4aae-a348-c5683ef62568

📥 Commits

Reviewing files that changed from the base of the PR and between 5388d26 and 3ec44ec.

📒 Files selected for processing (13)
  • apps/web/src/components/file-browser/AudioPlayerDialog.tsx
  • apps/web/src/components/file-browser/FileBrowser.tsx
  • apps/web/src/components/file-browser/InviteLinkTab.tsx
  • apps/web/src/components/file-browser/PdfPreviewDialog.tsx
  • apps/web/src/components/file-browser/ShareDialog.tsx
  • apps/web/src/components/settings/ConnectionTest.tsx
  • apps/web/src/hooks/useFileDownload.ts
  • apps/web/src/hooks/useFileOperations.ts
  • apps/web/src/hooks/useFileVersions.ts
  • apps/web/src/hooks/useFolderNavigation.ts
  • apps/web/src/hooks/useSharedNavigation.ts
  • apps/web/src/services/ipns.service.ts
  • apps/web/src/services/upload.service.ts

Walkthrough

Phase 28: Code Hygiene & Logging is marked complete with implementation of a structured logger, replacement of 124+ console calls with logger.* calls across the web app, conversion of silent .catch(() => {}) error handlers to logging-based handlers, removal of as any type casts via typed declarations, and archival of the legacy POC directory.

Changes

Cohort / File(s) Summary
Planning & Phase Completion
.planning/ROADMAP.md, .planning/STATE.md, .planning/phases/28-code-hygiene-logging/28-{01,02,03,04}-PLAN.md, .planning/phases/28-code-hygiene-logging/28-{01,02,03,04}-SUMMARY.md, .planning/phases/28-code-hygiene-logging/28-VERIFICATION.md
Marked Phase 28 complete with checklist updates, advanced phase progress counters (completed_phases 12→13, completed_plans 53→57), recorded completion date 2026-03-28, and documented verification criteria for all four plans (logger implementation, unpin error handling, type-safety fixes, POC archival).
Logger Implementation
apps/web/src/lib/logger.ts
New structured logger module exporting LogLevel enum and logger object with debug/info/warn/error methods. Level-filtered logging: production emits WARN+, development emits DEBUG+. Timestamp and level label prepended to output.
Web Components
apps/web/src/components/file-browser/*.tsx
Added logger import and replaced all console.error/warn calls with logger.error/warn in AudioPlayerDialog, BinBrowser, FileBrowser, InviteLinkTab, PdfPreviewDialog, ReplaceFileDialog, and ShareDialog. AudioPlayerDialog and ReplaceFileDialog additionally replaced empty .catch(() => {}) on unpin/cleanup failures with logging handlers.
Web Hooks
apps/web/src/hooks/use*.ts
Added logger import and replaced console.error/warn/log with logger.error/warn/info/debug in useAuth, useBin, useDropUpload, useFileDownload, useFileOperations, useFileVersions, useFolderNavigation, useSearch, useSharedNavigation, and ConnectionTest. Updated unpin/cleanup error handling from silent swallowing to logger.warn in useDropUpload, useFileOperations, and useFileVersions.
Web Services
apps/web/src/services/*.ts
Added logger import and systematically replaced console.* calls with logger.* in bin, delete, device-registry, folder, ipns, search-index, share, and upload services. Converted empty unpin .catch handlers to logger.warn logging in bin.service for multiple cleanup flows. All error propagation and control flow preserved.
Web App Type Safety & Configuration
apps/web/src/main.tsx, apps/web/src/polyfills.ts, apps/web/src/lib/crypto/key-wrapping.ts, apps/web/src/lib/sw-registration.ts, apps/web/src/lib/web3auth/core-kit-provider.tsx, apps/web/src/lib/web3auth/hooks.ts, apps/web/src/stores/folder.store.ts
Replaced as any casts with TypeScript global declarations: main.tsx adds ErrorLogEntry interface and Window augmentations for __errorLog/__errorCount; polyfills.ts adds declare global for process and Buffer; folder.store.ts adds typed Window.__ZUSTAND_FOLDER_STORE__ property. All console.* calls replaced with logger.* in lib files.
SDK Changes
packages/sdk/src/client.ts
Replaced silent unpin failure handler with console.warn logging in external+PSA pinning cleanup flow, making errors observable while maintaining non-blocking behavior.
Legacy POC Archival
00-Preliminary-R&D/ARCHIVED.md (added), 00-Preliminary-R&D/poc/* (removed)
Deleted entire POC directory (src/index.ts ∼702 lines, package.json, tsconfig.json, README.md, .env.example, state files, scripts). Added ARCHIVED.md documenting POC location, demonstrated capabilities (ECIES/AES-256-GCM encryption, IPFS/IPNS publishing), and git history preservation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The PR title 'feat: Phase 28 Code Hygiene & Logging' directly and clearly summarizes the main changes: introducing a structured logger, replacing console calls, fixing error handling, removing type casts, and archiving the POC directory.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/phase-28-code-hygiene-logging

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@FSM1 FSM1 mentioned this pull request Mar 28, 2026
5 tasks
@codecov

codecov Bot commented Mar 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.62%. Comparing base (766710f) to head (3ec44ec).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #382   +/-   ##
=======================================
  Coverage   60.61%   60.62%           
=======================================
  Files         128      128           
  Lines        9524     9526    +2     
  Branches      925      925           
=======================================
+ Hits         5773     5775    +2     
  Misses       3540     3540           
  Partials      211      211           
Flag Coverage Δ
api 84.32% <100.00%> (+<0.01%) ⬆️
api-client 84.32% <100.00%> (+<0.01%) ⬆️
core 84.32% <100.00%> (+<0.01%) ⬆️
crypto 84.32% <100.00%> (+<0.01%) ⬆️
sdk 84.32% <100.00%> (+<0.01%) ⬆️
sdk-core 84.32% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/sdk/src/client.ts 78.43% <100.00%> (+0.05%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@FSM1 FSM1 changed the title Phase 28: Code Hygiene & Logging feat: Phase 28 Code Hygiene & Logging Mar 28, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
apps/web/src/components/file-browser/BinBrowser.tsx (1)

214-214: Include caught error objects in bin action logs.

Current logs lose stack/cause context, which makes production debugging harder.

Proposed refactor
-      } catch {
-        logger.error('[Bin] Restore failed');
+      } catch (error) {
+        logger.error('[Bin] Restore failed:', error);
       }
-          } catch {
-            logger.error('[Bin] Permanent delete failed');
+          } catch (error) {
+            logger.error('[Bin] Permanent delete failed:', error);
           }
-    } catch {
-      logger.error('[Bin] Batch restore failed');
+    } catch (error) {
+      logger.error('[Bin] Batch restore failed:', error);
     }
-        } catch {
-          logger.error('[Bin] Batch permanent delete failed');
+        } catch (error) {
+          logger.error('[Bin] Batch permanent delete failed:', error);
         }
-        } catch {
-          logger.error('[Bin] Empty bin failed');
+        } catch (error) {
+          logger.error('[Bin] Empty bin failed:', error);
         }

Also applies to: 235-235, 263-263, 281-281, 301-301

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/components/file-browser/BinBrowser.tsx` at line 214, The bin
action error logs (e.g., the logger.error('[Bin] Restore failed') calls in the
BinBrowser component) drop the caught Error object and lose stack/cause context;
update each bin action catch block (restore, delete, permanent delete/empty
handlers in BinBrowser.tsx) to include the caught error by logging a descriptive
message plus the error object (e.g., logger.error('[Bin] Restore failed', error)
or logger.error(`[Bin] Restore failed: ${error.message}`, error)) so the full
error/stack is captured for debugging.
apps/web/src/hooks/useBin.ts (1)

59-61: Consider capturing the error object for debugging.

The catch handler doesn't capture the rejection error, so the logged message provides no diagnostic details. Adding the error parameter would improve observability.

♻️ Suggested improvement
       void purgeExpired({
         retentionDays: currentRetention,
         userPublicKey: auth.vaultKeypair.publicKey,
         userPrivateKey: auth.vaultKeypair.privateKey,
-      }).catch(() => {
-        logger.error('[useBin] Auto-purge failed (non-blocking)');
+      }).catch((err) => {
+        logger.error('[useBin] Auto-purge failed (non-blocking):', err);
       });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/hooks/useBin.ts` around lines 59 - 61, The catch handler in
useBin's auto-purge promise swallows the error; update the .catch callback to
accept an error parameter (e.g., err) and pass it into the logger.error call so
the message includes the actual error details (reference the .catch(...) on the
auto-purge promise and the logger.error('[useBin] Auto-purge failed
(non-blocking)') call) to improve observability.
apps/web/src/hooks/useAuth.ts (1)

164-164: logger.info() is silenced in production — consider if this diagnostic is needed.

This "new user initializing vault" message uses logger.info(), which is filtered out in production where minLevel is LogLevel.WARN. If this diagnostic is valuable for troubleshooting production onboarding issues, consider using logger.warn() instead, or accept that it's development-only instrumentation.

Per apps/web/src/lib/logger.ts lines 33-37, production only emits WARN and above.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/hooks/useAuth.ts` at line 164, The log call in useAuth.ts
currently uses logger.info('[Auth] New user -- initializing vault'), which is
filtered out in production; change this to logger.warn('[Auth] New user --
initializing vault') if you want this diagnostic to appear in production (or
explicitly document/leave it as info if it should remain development-only).
Update the call in the useAuth hook where that exact message is logged to use
logger.warn so it will be emitted when minLevel is LogLevel.WARN.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@apps/web/src/components/file-browser/BinBrowser.tsx`:
- Line 214: The bin action error logs (e.g., the logger.error('[Bin] Restore
failed') calls in the BinBrowser component) drop the caught Error object and
lose stack/cause context; update each bin action catch block (restore, delete,
permanent delete/empty handlers in BinBrowser.tsx) to include the caught error
by logging a descriptive message plus the error object (e.g.,
logger.error('[Bin] Restore failed', error) or logger.error(`[Bin] Restore
failed: ${error.message}`, error)) so the full error/stack is captured for
debugging.

In `@apps/web/src/hooks/useAuth.ts`:
- Line 164: The log call in useAuth.ts currently uses logger.info('[Auth] New
user -- initializing vault'), which is filtered out in production; change this
to logger.warn('[Auth] New user -- initializing vault') if you want this
diagnostic to appear in production (or explicitly document/leave it as info if
it should remain development-only). Update the call in the useAuth hook where
that exact message is logged to use logger.warn so it will be emitted when
minLevel is LogLevel.WARN.

In `@apps/web/src/hooks/useBin.ts`:
- Around line 59-61: The catch handler in useBin's auto-purge promise swallows
the error; update the .catch callback to accept an error parameter (e.g., err)
and pass it into the logger.error call so the message includes the actual error
details (reference the .catch(...) on the auto-purge promise and the
logger.error('[useBin] Auto-purge failed (non-blocking)') call) to improve
observability.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0b50e087-07bd-4504-a865-a31ebc842976

📥 Commits

Reviewing files that changed from the base of the PR and between e990dc7 and 5388d26.

⛔ Files ignored due to path filters (1)
  • 00-Preliminary-R&D/poc/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (53)
  • .planning/ROADMAP.md
  • .planning/STATE.md
  • .planning/phases/28-code-hygiene-logging/28-01-PLAN.md
  • .planning/phases/28-code-hygiene-logging/28-01-SUMMARY.md
  • .planning/phases/28-code-hygiene-logging/28-02-PLAN.md
  • .planning/phases/28-code-hygiene-logging/28-02-SUMMARY.md
  • .planning/phases/28-code-hygiene-logging/28-03-PLAN.md
  • .planning/phases/28-code-hygiene-logging/28-03-SUMMARY.md
  • .planning/phases/28-code-hygiene-logging/28-04-PLAN.md
  • .planning/phases/28-code-hygiene-logging/28-04-SUMMARY.md
  • .planning/phases/28-code-hygiene-logging/28-VERIFICATION.md
  • 00-Preliminary-R&D/ARCHIVED.md
  • 00-Preliminary-R&D/poc/.env.example
  • 00-Preliminary-R&D/poc/README.md
  • 00-Preliminary-R&D/poc/package.json
  • 00-Preliminary-R&D/poc/scripts/gen-private-key.ts
  • 00-Preliminary-R&D/poc/src/index.ts
  • 00-Preliminary-R&D/poc/state/state.json
  • 00-Preliminary-R&D/poc/tsconfig.json
  • apps/web/src/components/file-browser/AudioPlayerDialog.tsx
  • apps/web/src/components/file-browser/BinBrowser.tsx
  • apps/web/src/components/file-browser/FileBrowser.tsx
  • apps/web/src/components/file-browser/InviteLinkTab.tsx
  • apps/web/src/components/file-browser/PdfPreviewDialog.tsx
  • apps/web/src/components/file-browser/ReplaceFileDialog.tsx
  • apps/web/src/components/file-browser/ShareDialog.tsx
  • apps/web/src/components/settings/ConnectionTest.tsx
  • apps/web/src/hooks/useAuth.ts
  • apps/web/src/hooks/useBin.ts
  • apps/web/src/hooks/useDropUpload.ts
  • apps/web/src/hooks/useFileDownload.ts
  • apps/web/src/hooks/useFileOperations.ts
  • apps/web/src/hooks/useFileVersions.ts
  • apps/web/src/hooks/useFolderNavigation.ts
  • apps/web/src/hooks/useSearch.ts
  • apps/web/src/hooks/useSharedNavigation.ts
  • apps/web/src/lib/crypto/key-wrapping.ts
  • apps/web/src/lib/logger.ts
  • apps/web/src/lib/sw-registration.ts
  • apps/web/src/lib/web3auth/core-kit-provider.tsx
  • apps/web/src/lib/web3auth/hooks.ts
  • apps/web/src/main.tsx
  • apps/web/src/polyfills.ts
  • apps/web/src/services/bin.service.ts
  • apps/web/src/services/delete.service.ts
  • apps/web/src/services/device-registry.service.ts
  • apps/web/src/services/folder.service.ts
  • apps/web/src/services/ipns.service.ts
  • apps/web/src/services/search-index.service.ts
  • apps/web/src/services/share.service.ts
  • apps/web/src/services/upload.service.ts
  • apps/web/src/stores/folder.store.ts
  • packages/sdk/src/client.ts
💤 Files with no reviewable changes (7)
  • 00-Preliminary-R&D/poc/scripts/gen-private-key.ts
  • 00-Preliminary-R&D/poc/tsconfig.json
  • 00-Preliminary-R&D/poc/state/state.json
  • 00-Preliminary-R&D/poc/.env.example
  • 00-Preliminary-R&D/poc/package.json
  • 00-Preliminary-R&D/poc/README.md
  • 00-Preliminary-R&D/poc/src/index.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements Phase 28 “Code Hygiene & Logging” by introducing a structured web logger, making previously-silenced async failures visible, tightening TypeScript typings for global/window shims, and removing an obsolete PoC directory (with archival documentation).

Changes:

  • Added apps/web/src/lib/logger.ts and replaced most web-app console.* usage with logger.* calls.
  • Replaced silent .catch(() => {}) patterns (notably around IPFS unpin and AudioContext close) with warning logs.
  • Removed as any casts via declare global type augmentations; archived/removes 00-Preliminary-R&D/poc/ and updates planning docs/state.

Reviewed changes

Copilot reviewed 53 out of 54 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/sdk/src/client.ts Logs SDK unpin best-effort failures instead of silently swallowing them.
apps/web/src/stores/folder.store.ts Adds typed Window.__ZUSTAND_FOLDER_STORE__ for DEV/E2E access without as any.
apps/web/src/services/upload.service.ts Switches upload failure logging to structured logger.error.
apps/web/src/services/share.service.ts Replaces console warnings with logger.warn for share rotation/rewrap operations.
apps/web/src/services/search-index.service.ts Uses logger.warn for non-blocking IndexedDB persistence/load failures.
apps/web/src/services/ipns.service.ts Uses logger.warn for skipped signature verification scenarios.
apps/web/src/services/folder.service.ts Replaces console logs with structured logger for sync/publish/rotation warnings & errors.
apps/web/src/services/device-registry.service.ts Uses structured error logging while keeping registry failures non-blocking.
apps/web/src/services/delete.service.ts Uses logger.error when per-file deletes fail.
apps/web/src/services/bin.service.ts Makes bin/cleanup/unpin failures visible and routes logs through logger.
apps/web/src/polyfills.ts Replaces as any global shims with declare global augmentation and globalThis assignment.
apps/web/src/main.tsx Types DEV-only window error capture without as any.
apps/web/src/lib/web3auth/hooks.ts Replaces console logging with logger.* for CoreKit auth flow traces/errors.
apps/web/src/lib/web3auth/core-kit-provider.tsx Uses logger.error for CoreKit init failures.
apps/web/src/lib/sw-registration.ts Uses logger for SW support/registration warnings & errors.
apps/web/src/lib/logger.ts New structured logger wrapper with level filtering.
apps/web/src/lib/crypto/key-wrapping.ts Uses logger.error for key re-wrap failures while continuing traversal.
apps/web/src/hooks/useSharedNavigation.ts Routes shared navigation errors through structured logger.
apps/web/src/hooks/useSearch.ts Logs index persistence/init/clear issues via logger.
apps/web/src/hooks/useFolderNavigation.ts Uses logger.error for folder navigation/load failures.
apps/web/src/hooks/useFileVersions.ts Makes unpin failures visible via logger.warn.
apps/web/src/hooks/useFileOperations.ts Makes unpin failures visible and routes warnings via logger.
apps/web/src/hooks/useFileDownload.ts Uses logger.error for download failures.
apps/web/src/hooks/useDropUpload.ts Logs cleanup module-load and unpin failures instead of silently swallowing.
apps/web/src/hooks/useBin.ts Logs non-blocking auto-purge failures via logger.error.
apps/web/src/hooks/useAuth.ts Routes auth/vault init failures and non-blocking init errors through logger.
apps/web/src/components/settings/ConnectionTest.tsx Uses logger.warn for fallback path messaging.
apps/web/src/components/file-browser/ShareDialog.tsx Uses logger.error for share dialog failures.
apps/web/src/components/file-browser/ReplaceFileDialog.tsx Logs replace/unpin failures instead of silent catches.
apps/web/src/components/file-browser/PdfPreviewDialog.tsx Logs PDF load/render failures via logger.error.
apps/web/src/components/file-browser/InviteLinkTab.tsx Logs invite fetch/create/revoke failures via logger.error.
apps/web/src/components/file-browser/FileBrowser.tsx Uses structured logger for sync/move/download/delete/create failures.
apps/web/src/components/file-browser/BinBrowser.tsx Uses logger.error instead of console for restore/delete batch failures.
apps/web/src/components/file-browser/AudioPlayerDialog.tsx Logs AudioContext close/setup failures via logger.warn.
00-Preliminary-R&D/poc/yarn.lock Deletes legacy PoC lockfile as part of archiving/removal.
00-Preliminary-R&D/poc/tsconfig.json Deletes legacy PoC TS config as part of archiving/removal.
00-Preliminary-R&D/poc/state/state.json Deletes legacy PoC state file (contained sensitive-looking material).
00-Preliminary-R&D/poc/src/index.ts Deletes legacy PoC harness implementation.
00-Preliminary-R&D/poc/scripts/gen-private-key.ts Deletes legacy PoC key generation script.
00-Preliminary-R&D/poc/package.json Deletes legacy PoC package manifest.
00-Preliminary-R&D/poc/README.md Deletes legacy PoC documentation.
00-Preliminary-R&D/poc/.env.example Deletes legacy PoC env template.
00-Preliminary-R&D/ARCHIVED.md Adds provenance note documenting PoC removal and where to find it in history.
.planning/phases/28-code-hygiene-logging/28-VERIFICATION.md Adds Phase 28 verification record.
.planning/phases/28-code-hygiene-logging/28-04-SUMMARY.md Adds Plan 28-04 summary (archive PoC).
.planning/phases/28-code-hygiene-logging/28-04-PLAN.md Adds Plan 28-04 plan document.
.planning/phases/28-code-hygiene-logging/28-03-SUMMARY.md Adds Plan 28-03 summary (remove as any).
.planning/phases/28-code-hygiene-logging/28-03-PLAN.md Adds Plan 28-03 plan document.
.planning/phases/28-code-hygiene-logging/28-02-SUMMARY.md Adds Plan 28-02 summary (log unpin failures).
.planning/phases/28-code-hygiene-logging/28-02-PLAN.md Adds Plan 28-02 plan document.
.planning/phases/28-code-hygiene-logging/28-01-SUMMARY.md Adds Plan 28-01 summary (logger + replacements).
.planning/phases/28-code-hygiene-logging/28-01-PLAN.md Adds Plan 28-01 plan document.
.planning/STATE.md Advances planning state to Phase 28 complete / Phase 29 focus.
.planning/ROADMAP.md Marks Phase 28 complete and lists completed plans.

Comment thread apps/web/src/lib/logger.ts
Comment thread apps/web/src/polyfills.ts
Comment thread apps/web/src/lib/logger.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@FSM1
FSM1 enabled auto-merge (squash) March 28, 2026 04:15
@FSM1
FSM1 merged commit 9827f49 into main Mar 28, 2026
25 checks passed
FSM1 added a commit that referenced this pull request Mar 28, 2026
Resolve conflicts from Phase 28 squash merge (#382):
- Take main's logger module prefixes for all web app files
- Keep Phase 29 TODO cleanup in folder.service.ts
- Keep Phase 29 SDK unenrollment additions + prettier fix in client.ts
- Re-apply privacy fix (remove file.name from batch download log)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@FSM1
FSM1 deleted the feat/phase-28-code-hygiene-logging branch March 28, 2026 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants