ATlast — you'll never need to find your favorites on another platform again. Find your favs in the ATmosphere.
atproto

Compare changes

Choose any two refs to compare.

Changed files
+201 -21
docs
packages
extension
src
functions
src
core
middleware
+13 -13
docs/git-history.json
··· 1 1 [ 2 2 { 3 - "hash": "be9f4207b61429400e44ccfda326595c1087235c", 4 - "short_hash": "be9f420", 3 + "hash": "15b67054a684ebb2a21761a1774ba15f9b1c29e2", 4 + "short_hash": "15b6705", 5 5 "author": "Ariel M. Lighty", 6 - "date": "2025-12-28T19:21:29-05:00", 7 - "message": "feat: add Firefox support with webextension-polyfill\n\nImplemented cross-browser compatibility for the extension:\n\n- Installed webextension-polyfill for unified browser.* API\n- Replaced all chrome.* API calls with browser.* imports\n- Updated build system to output both chrome/ and firefox/ directories\n- Created Firefox-specific manifest with browser_specific_settings", 8 - "files_changed": 12 6 + "date": "2025-12-28T20:38:38-05:00", 7 + "message": "fix: add health check function for extension server detection\n\n- Created /health function endpoint with CORS support\n- Updated checkServerHealth to use function endpoint instead of root URL\n- Fixes Firefox extension server detection with proper CORS headers", 8 + "files_changed": 5 9 9 }, 10 10 { 11 11 "hash": "603cf0a187850664336a12c9e5cbb49038906f53", ··· 24 24 "files_changed": 5 25 25 }, 26 26 { 27 + "hash": "bd3aabb75abb1875aef125610fcdccb14967a8e3", 28 + "short_hash": "bd3aabb", 29 + "author": "Ariel M. Lighty", 30 + "date": "2025-12-27T22:10:11-05:00", 31 + "message": "fix: extension dark mode and build mode messaging\n\n- Changed darkMode from 'class' to 'media' for automatic system preference detection\n- Made server offline message conditional on build mode (dev vs prod)\n- Hide dev server instructions in production builds", 32 + "files_changed": 5 33 + }, 34 + { 27 35 "hash": "d07180cd3a19328b82b35118e525b59d4e2e060b", 28 36 "short_hash": "d07180c", 29 37 "author": "Ariel M. Lighty", 30 38 "date": "2025-12-27T18:38:39-05:00", 31 39 "message": "feat: add Tailwind CSS to extension\n\nReplaced 299 lines of vanilla CSS with Tailwind for design consistency with web app. Production build minified to 13KB.", 32 40 "files_changed": 9 33 - }, 34 - { 35 - "hash": "6ac877ee6d1990bdab4ef3b03ac59f4682afe0a5", 36 - "short_hash": "6ac877e", 37 - "author": "Ariel M. Lighty", 38 - "date": "2025-12-27T16:03:56-05:00", 39 - "message": "docs: update decision graph after markdown updates", 40 - "files_changed": 2 41 41 }, 42 42 { 43 43 "hash": "fe29bb3e5faa0151f63c14724f7509af669860de",
+158 -4
docs/graph-data.json
··· 4263 4263 "node_type": "observation", 4264 4264 "title": "Health check uses HEAD request to root URL (Vite server), not a Netlify function. Doesn't get CORS headers from getCorsHeaders. Need dedicated health endpoint or change check to use existing function.", 4265 4265 "description": null, 4266 - "status": "pending", 4266 + "status": "completed", 4267 4267 "created_at": "2025-12-28T20:37:22.132717600-05:00", 4268 - "updated_at": "2025-12-28T20:37:22.132717600-05:00", 4268 + "updated_at": "2025-12-28T20:38:41.630020900-05:00", 4269 4269 "metadata_json": "{\"branch\":\"master\",\"confidence\":95}" 4270 4270 }, 4271 4271 { ··· 4274 4274 "node_type": "outcome", 4275 4275 "title": "Created /health function endpoint with CORS support. Updated checkServerHealth to use /.netlify/functions/health instead of root URL. Extension rebuilt successfully.", 4276 4276 "description": null, 4277 + "status": "completed", 4278 + "created_at": "2025-12-28T20:38:19.981309500-05:00", 4279 + "updated_at": "2025-12-28T20:38:41.780183300-05:00", 4280 + "metadata_json": "{\"branch\":\"master\",\"confidence\":95}" 4281 + }, 4282 + { 4283 + "id": 390, 4284 + "change_id": "cfdcf45b-47b3-4239-8053-417bd31957ed", 4285 + "node_type": "observation", 4286 + "title": "Server receives session request but returns CORS wildcard (*) instead of extension origin. No session cookie received. Origin header might not be sent by Firefox extension or not detected correctly.", 4287 + "description": null, 4277 4288 "status": "pending", 4278 - "created_at": "2025-12-28T20:38:19.981309500-05:00", 4279 - "updated_at": "2025-12-28T20:38:19.981309500-05:00", 4289 + "created_at": "2025-12-28T20:48:12.770638500-05:00", 4290 + "updated_at": "2025-12-28T20:48:12.770638500-05:00", 4291 + "metadata_json": "{\"branch\":\"master\",\"confidence\":95}" 4292 + }, 4293 + { 4294 + "id": 391, 4295 + "change_id": "2b53a419-9a47-4285-9a12-9bdfaeeb9ff0", 4296 + "node_type": "observation", 4297 + "title": "Health endpoint gets CORS headers correctly (moz-extension detected). Session endpoint error middleware doesn't pass event to errorResponse, returns wildcard CORS. Need to fix error middleware to pass event.", 4298 + "description": null, 4299 + "status": "completed", 4300 + "created_at": "2025-12-28T20:55:32.024834200-05:00", 4301 + "updated_at": "2025-12-28T21:38:14.729731500-05:00", 4302 + "metadata_json": "{\"branch\":\"master\",\"confidence\":95}" 4303 + }, 4304 + { 4305 + "id": 392, 4306 + "change_id": "c941d136-3405-483d-bf34-7fb011f6d072", 4307 + "node_type": "action", 4308 + "title": "Fixed error middleware to pass event to errorResponse for proper CORS headers on errors", 4309 + "description": null, 4310 + "status": "completed", 4311 + "created_at": "2025-12-28T20:56:38.876266200-05:00", 4312 + "updated_at": "2025-12-28T21:38:14.888627800-05:00", 4313 + "metadata_json": "{\"branch\":\"master\",\"confidence\":95}" 4314 + }, 4315 + { 4316 + "id": 393, 4317 + "change_id": "aafd9977-8800-4152-9f7f-b817db6df573", 4318 + "node_type": "outcome", 4319 + "title": "Fixed Firefox extension CORS completely. Error middleware now passes event to errorResponse so Firefox extension origin is properly reflected in error responses with credentials. Debug logging removed.", 4320 + "description": null, 4321 + "status": "completed", 4322 + "created_at": "2025-12-28T21:37:22.780953600-05:00", 4323 + "updated_at": "2025-12-28T21:38:15.071425500-05:00", 4324 + "metadata_json": "{\"branch\":\"master\",\"confidence\":95}" 4325 + }, 4326 + { 4327 + "id": 394, 4328 + "change_id": "3b0dea7a-c3cd-45a8-ba1a-f1040aa4e1d9", 4329 + "node_type": "observation", 4330 + "title": "CORS fully working - Firefox extension origin properly reflected with credentials. But cookies not sent from extension despite credentials:include. Cookie set in web context not accessible from extension context due to Firefox cookie partitioning.", 4331 + "description": null, 4332 + "status": "pending", 4333 + "created_at": "2025-12-28T21:46:45.822343200-05:00", 4334 + "updated_at": "2025-12-28T21:46:45.822343200-05:00", 4335 + "metadata_json": "{\"branch\":\"master\",\"confidence\":95}" 4336 + }, 4337 + { 4338 + "id": 395, 4339 + "change_id": "8a93413f-a09c-4cc1-8693-4fe90dc055c4", 4340 + "node_type": "action", 4341 + "title": "Updated extension checkSession to read cookie via browser.cookies API and pass as query parameter. Workaround for Firefox SameSite=Lax cookie partitioning.", 4342 + "description": null, 4343 + "status": "pending", 4344 + "created_at": "2025-12-28T21:52:22.059862700-05:00", 4345 + "updated_at": "2025-12-28T21:52:22.059862700-05:00", 4346 + "metadata_json": "{\"branch\":\"master\",\"confidence\":95}" 4347 + }, 4348 + { 4349 + "id": 396, 4350 + "change_id": "864dd973-5f15-4e31-a7da-c548dbbe1f0e", 4351 + "node_type": "outcome", 4352 + "title": "Extension now uses browser.cookies.get() API to read session cookie and pass as query parameter. Workaround for Firefox SameSite=Lax cookie partitioning in extensions. Extension rebuilt successfully.", 4353 + "description": null, 4354 + "status": "pending", 4355 + "created_at": "2025-12-28T22:51:31.578965200-05:00", 4356 + "updated_at": "2025-12-28T22:51:31.578965200-05:00", 4280 4357 "metadata_json": "{\"branch\":\"master\",\"confidence\":95}" 4281 4358 } 4282 4359 ], ··· 8515 8592 "weight": 1.0, 8516 8593 "rationale": "Fix implemented", 8517 8594 "created_at": "2025-12-28T20:38:22.044029100-05:00" 8595 + }, 8596 + { 8597 + "id": 386, 8598 + "from_node_id": 389, 8599 + "to_node_id": 390, 8600 + "from_change_id": "f522d5b2-c325-4f34-9f27-b8ea5c50618d", 8601 + "to_change_id": "cfdcf45b-47b3-4239-8053-417bd31957ed", 8602 + "edge_type": "leads_to", 8603 + "weight": 1.0, 8604 + "rationale": "Issue persists - need to debug headers", 8605 + "created_at": "2025-12-28T20:48:14.949702100-05:00" 8606 + }, 8607 + { 8608 + "id": 387, 8609 + "from_node_id": 390, 8610 + "to_node_id": 391, 8611 + "from_change_id": "cfdcf45b-47b3-4239-8053-417bd31957ed", 8612 + "to_change_id": "2b53a419-9a47-4285-9a12-9bdfaeeb9ff0", 8613 + "edge_type": "leads_to", 8614 + "weight": 1.0, 8615 + "rationale": "Root cause identified from debug logs", 8616 + "created_at": "2025-12-28T20:55:34.094943700-05:00" 8617 + }, 8618 + { 8619 + "id": 388, 8620 + "from_node_id": 391, 8621 + "to_node_id": 392, 8622 + "from_change_id": "2b53a419-9a47-4285-9a12-9bdfaeeb9ff0", 8623 + "to_change_id": "c941d136-3405-483d-bf34-7fb011f6d072", 8624 + "edge_type": "leads_to", 8625 + "weight": 1.0, 8626 + "rationale": "Fix implemented", 8627 + "created_at": "2025-12-28T20:57:35.872426900-05:00" 8628 + }, 8629 + { 8630 + "id": 389, 8631 + "from_node_id": 392, 8632 + "to_node_id": 393, 8633 + "from_change_id": "c941d136-3405-483d-bf34-7fb011f6d072", 8634 + "to_change_id": "aafd9977-8800-4152-9f7f-b817db6df573", 8635 + "edge_type": "leads_to", 8636 + "weight": 1.0, 8637 + "rationale": "Complete fix with cleanup", 8638 + "created_at": "2025-12-28T21:37:27.704906300-05:00" 8639 + }, 8640 + { 8641 + "id": 390, 8642 + "from_node_id": 393, 8643 + "to_node_id": 394, 8644 + "from_change_id": "aafd9977-8800-4152-9f7f-b817db6df573", 8645 + "to_change_id": "3b0dea7a-c3cd-45a8-ba1a-f1040aa4e1d9", 8646 + "edge_type": "leads_to", 8647 + "weight": 1.0, 8648 + "rationale": "New issue - cookie partitioning", 8649 + "created_at": "2025-12-28T21:46:48.417911400-05:00" 8650 + }, 8651 + { 8652 + "id": 391, 8653 + "from_node_id": 394, 8654 + "to_node_id": 395, 8655 + "from_change_id": "3b0dea7a-c3cd-45a8-ba1a-f1040aa4e1d9", 8656 + "to_change_id": "8a93413f-a09c-4cc1-8693-4fe90dc055c4", 8657 + "edge_type": "leads_to", 8658 + "weight": 1.0, 8659 + "rationale": "Workaround using browser.cookies API", 8660 + "created_at": "2025-12-28T21:52:52.704792400-05:00" 8661 + }, 8662 + { 8663 + "id": 392, 8664 + "from_node_id": 395, 8665 + "to_node_id": 396, 8666 + "from_change_id": "8a93413f-a09c-4cc1-8693-4fe90dc055c4", 8667 + "to_change_id": "864dd973-5f15-4e31-a7da-c548dbbe1f0e", 8668 + "edge_type": "leads_to", 8669 + "weight": 1.0, 8670 + "rationale": "Complete workaround", 8671 + "created_at": "2025-12-28T22:51:33.159870400-05:00" 8518 8672 } 8519 8673 ] 8520 8674 }
+26 -2
packages/extension/src/lib/api-client.ts
··· 116 116 avatar?: string; 117 117 } | null> { 118 118 try { 119 - const response = await fetch(`${ATLAST_API_URL}/.netlify/functions/session`, { 119 + // Try to get session cookie using browser.cookies API 120 + // This works around Firefox's cookie partitioning for extensions 121 + let sessionId: string | null = null; 122 + 123 + try { 124 + const cookieName = __BUILD_MODE__ === 'production' ? 'atlast_session' : 'atlast_session_dev'; 125 + const cookie = await browser.cookies.get({ 126 + url: ATLAST_API_URL, 127 + name: cookieName 128 + }); 129 + 130 + if (cookie) { 131 + sessionId = cookie.value; 132 + console.log('[API Client] Found session cookie:', cookieName); 133 + } 134 + } catch (cookieError) { 135 + console.log('[API Client] Could not read cookie:', cookieError); 136 + } 137 + 138 + // Build URL with session parameter if we have one 139 + const url = sessionId 140 + ? `${ATLAST_API_URL}/.netlify/functions/session?session=${sessionId}` 141 + : `${ATLAST_API_URL}/.netlify/functions/session`; 142 + 143 + const response = await fetch(url, { 120 144 method: 'GET', 121 - credentials: 'include', // Include cookies 145 + credentials: 'include', // Include cookies as fallback 122 146 headers: { 123 147 'Accept': 'application/json' 124 148 }
+4 -2
packages/functions/src/core/middleware/error.middleware.ts
··· 21 21 } 22 22 23 23 if (error instanceof ApiError) { 24 - return errorResponse(error.message, error.statusCode, error.details); 24 + return errorResponse(error.message, error.statusCode, error.details, event); 25 25 } 26 26 27 27 // Unknown errors ··· 29 29 "Internal server error", 30 30 500, 31 31 error instanceof Error ? error.message : "Unknown error", 32 + event, 32 33 ); 33 34 } 34 35 }; ··· 48 49 console.error("Authenticated handler error:", error); 49 50 50 51 if (error instanceof ApiError) { 51 - return errorResponse(error.message, error.statusCode, error.details); 52 + return errorResponse(error.message, error.statusCode, error.details, event); 52 53 } 53 54 54 55 return errorResponse( 55 56 "Internal server error", 56 57 500, 57 58 error instanceof Error ? error.message : "Unknown error", 59 + event, 58 60 ); 59 61 } 60 62 };