fix: handle None from supabase maybe_single() in dedup lookups#100
Open
fix: handle None from supabase maybe_single() in dedup lookups#100
Conversation
Formatting, async Supabase migration, improved error handling, and logging across routes and services.
Add frontend Dockerfiles, ESLint, Prettier, Vercel config, and nginx. Update docker-compose, env example, and lint workflow.
Remove broken route-level tests from test_ingest (referenced removed functions). Update test_storage and test_dataset_name_validation for current service signatures.
23 tests exercising full HTTP request → route → service → response chain. Covers upload, search, graph, document CRUD, file-url, and health check endpoints. External services mocked at SDK boundary.
Replace standalone script with pytest-discoverable e2e test. Creates temp fixture data (no external mock_data needed), uses Cognee embedded defaults (LanceDB/KuzuDB), auto-skips when LLM_API_KEY is missing.
Run pytest on every PR touching backend/. Excludes broken test_storage and e2e test_cognee. Adds pip caching, pytest-asyncio dependency, and registers the e2e marker in pyproject.toml.
Architecture overview, key files, environment variables, run/test commands, branch naming conventions, and code review checklist.
…, and cross-page navigation Fixes the graph flipping/bouncing bug by stabilizing the force simulation (cooldownTicks, d3AlphaDecay, d3VelocityDecay, warmupTicks) and memoizing graph data to prevent unnecessary re-renders. Adds: - Click-to-inspect node detail panel with connected entities, related content (Cognee CHUNKS search), and source documents - Connected node highlighting: selected node glows, neighbors stay visible, unrelated nodes dim to 20% opacity - Graph node search (client-side filter with dropdown, zoom-to-node) - Search-to-graph bridge: "View in Graph" button on search result source cards navigates to /graph?dataset=X - URL param support: ?dataset= auto-selects filter, ?node= auto-selects and zooms to a node - Improved UI: overlaid controls, polished hover tooltip, degree-based node sizing, UUID label filtering Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Compute a SHA-256 hash of file contents at upload time and check for an existing completed document with the same hash before running the pipeline. Duplicates return the existing document immediately, skipping R2 upload, LLM classification, and Cognee ingestion. Frontend shows a distinct amber "Duplicate" card with a link to the existing document. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace outdated ETL-era README with practical setup instructions covering Docker and manual workflows, project structure, API endpoints, testing, linting, CI/CD, and branch/PR conventions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
find_document_by_hash() and get_document() use .maybe_single().execute(), which returns None (not a result wrapper) when zero rows match in the async supabase-py client. The old result.data access raised AttributeError on every upload of a new (non-duplicate) file. Check for None before accessing .data. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
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
find_document_by_hash()andget_document()use.maybe_single().execute()on the async supabase-py client, which returnsNone(not a result wrapper) when zero rows match.result.dataaccess raisedAttributeError: 'NoneType' object has no attribute 'data'on every upload of a brand-new file.result is Nonebefore touching.data.Test plan
cd backend && pytest— 61 tests pass.ruff checkclean.duplicate: true.🤖 Generated with Claude Code