-
Notifications
You must be signed in to change notification settings - Fork 14
Open
0 / 50 of 5 issues completedOpen
0 / 50 of 5 issues completed
Copy link
Description
Overview
This feature introduces the ability for users to have multiple sendtags associated with their send account and select a "main" sendtag that is displayed throughout the app.
Branch Information
- Current branch:
send_account_tags_rebased
- Original branch (pre-rebase):
send_account_tags
- Base branch:
dev
Completed Work
✅ Database Schema Updates
- Created
send_account_tags
junction table linking send accounts to tags - Added
send_accounts.main_tag_id
column for main tag selection - Modified
tags
table to use numeric IDs as primary keys - Created comprehensive migration strategy preserving existing data
- Added validation triggers for main_tag_id
✅ API Changes
- Created
tag.create
endpoint for creating pending tags - Created
tag.delete
endpoint for removing tags from accounts - Created
sendAccount.updateMainTag
endpoint for main tag selection - Updated
tag.confirm
to work with send_account_id
✅ Frontend Updates
- Account Sendtag Screen displays all user tags with main tag first
- Profile displays show main tag preferentially
- Activity feed updated to display main tags
- Added main_tag_id and main_tag_name to user schemas
✅ Testing Updates
- Comprehensive test suite updates for new relationships
- New test files for send_account_tags functionality
- Updated Playwright E2E tests
Outstanding Issues & TODOs
🔴 Critical Issues
-
registerFirstSendtag Integration Broken (CRITICAL)
- Location:
packages/api/src/routers/tag/router.ts:130-164
- Issue: Directly inserts into
tags
table usinguser_id
, bypassingsend_account_tags
junction table - Impact: First free sendtag created during sign-up/onboarding is not properly linked to send accounts
- Required Fix: Update to use
create_tag
RPC function with send_account_id - Sign-up flow:
packages/app/features/auth/sign-up/screen.tsx:98-111
- Onboarding flow:
packages/app/features/auth/onboarding/screen.tsx:87-100
- Location:
-
API Validation Missing in updateMainTag (HIGH)
- Location:
packages/api/src/routers/sendAccount.ts
- Missing validation to ensure:
- Tag exists
- Tag belongs to user's send account
- Tag is confirmed (not pending)
- Risk: Users could set main_tag_id to invalid values
- Location:
🟡 Medium Priority Issues
-
Database Migration Issues
- Missing column drop: Migration references dropping
referrals.tag
column that was never dropped - Location:
supabase/migrations/20250118103228_update_tag_functions.sql:593
- Function compatibility:
check_tags_allowlist_before_insert_func
still assumes direct user_id relationship
- Missing column drop: Migration references dropping
-
Performance - Missing Indexes
- Tables needing indexes:
referrals.tag_id
send_accounts.main_tag_id
send_account_tags
foreign keys
- Tables needing indexes:
📋 Sub-Issues to Create
- Fix registerFirstSendtag to properly integrate with send_account_tags (CRITICAL)
- Add validation to updateMainTag endpoint (HIGH)
- Fix database migration issues (MEDIUM)
- Add missing database indexes (MEDIUM)
- Run comprehensive test suite (MEDIUM)
Testing Commands
# Run Supabase tests
cd supabase && yarn supabase test
# Run Playwright tests
cd packages/playwright && yarn playwright test
# Run API tests
cd packages/api && yarn test | cat
Key Benefits
- Users can own multiple sendtags under one send account
- Users can switch their main tag without losing other tags
- Consistent display of user's preferred tag across the app
- Architecture supports future features like tag trading or transfers
Breaking Changes
- Tags now use numeric IDs instead of names as primary keys
- Tag references throughout codebase updated from name-based to ID-based
- Some API endpoints have different parameter requirements
Documentation
See send_account_tags_summary.md
for detailed implementation notes and code references.
Sub-issues
Metadata
Metadata
Assignees
Labels
No labels