Fix migration dates, add multi-platform testing infrastructure, and organize docs
Migration Date Corrections: - Update all migration TODO comments to use correct date: 2025-07-06 - Add proper TypeScript type declarations for $route and $router in DeepLinkErrorView - Fix template property references to use $route instead of route Multi-Platform Testing Infrastructure: - Add comprehensive multi-platform testing requirements for migrations - Update component migration template with platform testing requirements - Establish sign-off requirements for web, desktop, and mobile platforms - Document expected outcomes and validation procedures Migration Testing Organization: - Create docs/migration-testing/ folder for testing documentation - Move TESTING_CONTACTIMPORT.md from project root to migration-testing/ - Relocate all migration-checklist-*.md files to migration-testing/ - Add comprehensive README.md with organization guidelines - Update file references in components and TODOs - Establish naming conventions and quality standards Files added: - docs/migration-testing/README.md - docs/migration-testing/TESTING_CONTACTIMPORT.md - docs/migration-testing/migration-checklist-ContactImportView.md - docs/migration-testing/migration-checklist-MembersList.md Files modified: - src/views/ContactImportView.vue (date correction) - src/components/MembersList.vue (date correction, reference path update) - src/views/DeepLinkErrorView.vue (date correction, Vue router types) - docs/migration-templates/component-migration.md (multi-platform requirements) Files moved: - TESTING_CONTACTIMPORT.md → docs/migration-testing/ - docs/migration-checklist-*.md → docs/migration-testing/ This establishes comprehensive testing infrastructure for all future migrations with proper organization and multi-platform validation requirements.
This commit is contained in:
@@ -213,4 +213,102 @@ try {
|
||||
|
||||
- Mixin methods include caching for frequently accessed data
|
||||
- Database operations are queued and optimized
|
||||
- Error logging includes proper context and formatting
|
||||
- Error logging includes proper context and formatting
|
||||
|
||||
## Phase 4: Testing and Validation
|
||||
|
||||
### 4.1 Multi-Platform Testing Requirements
|
||||
|
||||
**ALL MIGRATIONS MUST BE TESTED ON ALL SUPPORTED PLATFORMS:**
|
||||
|
||||
#### Web Platform Testing (Required)
|
||||
- [ ] Test in Chrome/Chromium (primary browser)
|
||||
- [ ] Test in Firefox (secondary browser)
|
||||
- [ ] Test in Safari (if applicable)
|
||||
- [ ] Verify PWA functionality works correctly
|
||||
- [ ] Test responsive design on different screen sizes
|
||||
|
||||
#### Desktop Platform Testing (Required)
|
||||
- [ ] Test Electron app functionality
|
||||
- [ ] Verify desktop-specific features work
|
||||
- [ ] Test file system access (if applicable)
|
||||
- [ ] Verify native desktop integrations
|
||||
|
||||
#### Mobile Platform Testing (Required)
|
||||
- [ ] Test iOS app via Capacitor
|
||||
- [ ] Test Android app via Capacitor
|
||||
- [ ] Verify mobile-specific features (camera, contacts, etc.)
|
||||
- [ ] Test deep linking functionality
|
||||
- [ ] Verify push notifications work
|
||||
|
||||
### 4.2 Functional Testing Per Platform
|
||||
|
||||
For each platform, test these core scenarios:
|
||||
|
||||
#### Database Operations
|
||||
- [ ] Create/Read/Update/Delete operations work
|
||||
- [ ] Data persistence across app restarts
|
||||
- [ ] Database migration handling (if applicable)
|
||||
|
||||
#### Logging and Error Handling
|
||||
- [ ] Errors are logged correctly to console
|
||||
- [ ] Errors are stored in database logs
|
||||
- [ ] Error messages display appropriately to users
|
||||
- [ ] Network errors are handled gracefully
|
||||
|
||||
#### User Interface
|
||||
- [ ] All buttons and interactions work
|
||||
- [ ] Loading states display correctly
|
||||
- [ ] Error states display appropriately
|
||||
- [ ] Responsive design works on platform
|
||||
|
||||
### 4.3 Platform-Specific Testing Notes
|
||||
|
||||
#### Web Platform
|
||||
- Test offline/online scenarios
|
||||
- Verify IndexedDB storage works
|
||||
- Test service worker functionality
|
||||
- Check browser developer tools for errors
|
||||
|
||||
#### Desktop Platform
|
||||
- Test native menu integrations
|
||||
- Verify file system permissions
|
||||
- Test auto-updater functionality
|
||||
- Check Electron developer tools
|
||||
|
||||
#### Mobile Platform
|
||||
- Test device permissions (camera, storage, etc.)
|
||||
- Verify app store compliance
|
||||
- Test background/foreground transitions
|
||||
- Check native debugging tools
|
||||
|
||||
### 4.4 Sign-Off Requirements
|
||||
|
||||
**MIGRATION IS NOT COMPLETE UNTIL ALL PLATFORMS ARE TESTED AND SIGNED OFF:**
|
||||
|
||||
```markdown
|
||||
## Testing Sign-Off Checklist
|
||||
|
||||
### Web Platform ✅/❌
|
||||
- [ ] Chrome: Tested by [Name] on [Date]
|
||||
- [ ] Firefox: Tested by [Name] on [Date]
|
||||
- [ ] Safari: Tested by [Name] on [Date]
|
||||
- [ ] Notes: [Any platform-specific issues or observations]
|
||||
|
||||
### Desktop Platform ✅/❌
|
||||
- [ ] Windows: Tested by [Name] on [Date]
|
||||
- [ ] macOS: Tested by [Name] on [Date]
|
||||
- [ ] Linux: Tested by [Name] on [Date]
|
||||
- [ ] Notes: [Any platform-specific issues or observations]
|
||||
|
||||
### Mobile Platform ✅/❌
|
||||
- [ ] iOS: Tested by [Name] on [Date]
|
||||
- [ ] Android: Tested by [Name] on [Date]
|
||||
- [ ] Notes: [Any platform-specific issues or observations]
|
||||
|
||||
### Final Sign-Off
|
||||
- [ ] All platforms tested and working
|
||||
- [ ] No regressions identified
|
||||
- [ ] Performance is acceptable
|
||||
- [ ] Migration completed by: [Name] on [Date]
|
||||
```
|
||||
112
docs/migration-testing/README.md
Normal file
112
docs/migration-testing/README.md
Normal file
@@ -0,0 +1,112 @@
|
||||
# Migration Testing Documentation
|
||||
|
||||
This folder contains testing documentation and checklists for PlatformServiceMixin migration validation.
|
||||
|
||||
## Folder Structure
|
||||
|
||||
```
|
||||
docs/migration-testing/
|
||||
├── README.md # This file
|
||||
├── TESTING_CONTACTIMPORT.md # Quick testing guide for ContactImportView
|
||||
├── migration-checklist-ContactImportView.md # Comprehensive testing checklist
|
||||
├── migration-checklist-MembersList.md # Comprehensive testing checklist
|
||||
└── [future-migration-checklists.md] # Additional component checklists
|
||||
```
|
||||
|
||||
## Document Types
|
||||
|
||||
### Quick Testing Guides (`TESTING_*.md`)
|
||||
- **Purpose**: Ready-to-use testing instructions for immediate validation
|
||||
- **Content**: Test URLs, validation steps, success criteria
|
||||
- **Usage**: During active development and testing
|
||||
- **Format**: `TESTING_[ComponentName].md`
|
||||
|
||||
### Migration Checklists (`migration-checklist-*.md`)
|
||||
- **Purpose**: Comprehensive testing documentation for component migrations
|
||||
- **Content**: Detailed test cases, platform requirements, sign-off checklists
|
||||
- **Usage**: Complete migration validation and documentation
|
||||
- **Format**: `migration-checklist-[ComponentName].md`
|
||||
|
||||
## Testing Workflow
|
||||
|
||||
### 1. Component Migration Completed
|
||||
- Create comprehensive migration checklist using template
|
||||
- Document all changes and requirements
|
||||
- Include platform-specific testing notes
|
||||
|
||||
### 2. Quick Testing Setup
|
||||
- Create quick testing guide with URLs and validation steps
|
||||
- Prepare test data and scenarios
|
||||
- Set up development environment
|
||||
|
||||
### 3. Platform Testing
|
||||
- **Web**: Test in Chrome, Firefox, Safari
|
||||
- **Desktop**: Test Electron app on Windows, macOS, Linux
|
||||
- **Mobile**: Test Capacitor app on iOS, Android
|
||||
|
||||
### 4. Validation and Sign-Off
|
||||
- Complete all checklist items
|
||||
- Document results and any issues
|
||||
- Get sign-off for each platform
|
||||
- Mark migration as complete
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- **Migration Templates**: `../migration-templates/`
|
||||
- **Best Practices**: `../migration-templates/best-practices.md`
|
||||
- **Component Migration Guide**: `../migration-templates/component-migration.md`
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Testing a New Migration
|
||||
1. Copy template from `../migration-templates/component-migration.md`
|
||||
2. Create `migration-checklist-[Component].md` in this folder
|
||||
3. Create `TESTING_[Component].md` for quick validation
|
||||
4. Follow testing workflow above
|
||||
5. Document results and get platform sign-offs
|
||||
|
||||
### Referencing in Component Files
|
||||
```typescript
|
||||
// Reference: docs/migration-testing/migration-checklist-[Component].md
|
||||
```
|
||||
|
||||
## File Naming Conventions
|
||||
|
||||
- **Quick Testing**: `TESTING_[ComponentName].md`
|
||||
- **Migration Checklist**: `migration-checklist-[ComponentName].md`
|
||||
- **Use PascalCase** for component names (e.g., `ContactImportView`, `MembersList`)
|
||||
- **Keep consistent** with Vue component file names
|
||||
|
||||
## Testing Infrastructure
|
||||
|
||||
### Required Tools
|
||||
- Web browser with developer tools
|
||||
- Development server running
|
||||
- Database inspection tools (IndexedDB viewer)
|
||||
- Platform-specific debugging tools
|
||||
|
||||
### Test Data Templates
|
||||
Each testing document should include:
|
||||
- Valid test data examples
|
||||
- Invalid data for error testing
|
||||
- Edge case scenarios
|
||||
- Performance test cases
|
||||
|
||||
## Quality Standards
|
||||
|
||||
### All Testing Documents Must Include
|
||||
- ✅ Multi-platform testing requirements
|
||||
- ✅ Functional test cases
|
||||
- ✅ Error handling validation
|
||||
- ✅ Database operation verification
|
||||
- ✅ Logging validation
|
||||
- ✅ Performance criteria
|
||||
- ✅ Sign-off checklists
|
||||
|
||||
### Migration Completion Criteria
|
||||
- ✅ Web platform tested and signed off
|
||||
- ✅ Desktop platform tested and signed off
|
||||
- ✅ Mobile platform tested and signed off
|
||||
- ✅ No regressions identified
|
||||
- ✅ Performance meets standards
|
||||
- ✅ Documentation complete
|
||||
80
docs/migration-testing/TESTING_CONTACTIMPORT.md
Normal file
80
docs/migration-testing/TESTING_CONTACTIMPORT.md
Normal file
@@ -0,0 +1,80 @@
|
||||
# ContactImportView.vue Testing Guide
|
||||
|
||||
## Quick Testing Setup
|
||||
- Web server running at: `http://localhost:3000`
|
||||
- Migration completed: 2025-07-06
|
||||
- Component: `src/views/ContactImportView.vue`
|
||||
|
||||
## Test URLs (Copy/Paste into Browser)
|
||||
|
||||
### 1. Basic Page Load
|
||||
```
|
||||
http://localhost:3000/contact-import
|
||||
```
|
||||
**Expected**: Manual JWT input page loads
|
||||
|
||||
### 2. Single Contact Import
|
||||
```
|
||||
http://localhost:3000/contact-import?contacts=[{"did":"did:test:123","name":"Test User"}]
|
||||
```
|
||||
**Expected**: "Test User" appears in import list
|
||||
|
||||
### 3. Multiple Contacts Import
|
||||
```
|
||||
http://localhost:3000/contact-import?contacts=[{"did":"did:test:alice","name":"Alice"},{"did":"did:test:bob","name":"Bob"}]
|
||||
```
|
||||
**Expected**: Both contacts appear in import list
|
||||
|
||||
### 4. Malformed Data Test
|
||||
Navigate to basic page and paste this into textarea:
|
||||
```
|
||||
[{"invalid":"data","missing":"did"}]
|
||||
```
|
||||
**Expected**: Error message displays
|
||||
|
||||
## Browser Developer Tools Validation
|
||||
|
||||
### Console Tab
|
||||
- Check for errors during page load
|
||||
- Verify error logging works (test malformed data)
|
||||
- Look for properly formatted log messages
|
||||
|
||||
### Application Tab
|
||||
- Navigate to: IndexedDB → TimeSafari
|
||||
- Check `contacts` table for imported contacts
|
||||
- Check `logs` table for error entries
|
||||
|
||||
### Network Tab
|
||||
- Monitor API calls during import
|
||||
- Verify visibility setting API calls (if enabled)
|
||||
|
||||
## Testing Checklist
|
||||
|
||||
### Web Platform (Chrome) ✅/❌
|
||||
- [ ] Basic page loads without errors
|
||||
- [ ] Single contact import works
|
||||
- [ ] Multiple contacts import works
|
||||
- [ ] Database operations work (check IndexedDB)
|
||||
- [ ] Error handling works (malformed data)
|
||||
- [ ] Logging works (console + database)
|
||||
- [ ] Visibility setting works
|
||||
- [ ] Duplicate detection works
|
||||
|
||||
### Expected Database Operations
|
||||
- **Insert**: New contacts added to contacts table
|
||||
- **Update**: Existing contacts updated if imported again
|
||||
- **Logging**: Errors recorded in logs table
|
||||
- **Persistence**: Data survives page refresh
|
||||
|
||||
### Success Criteria
|
||||
- ✅ No console errors during normal operation
|
||||
- ✅ Contacts successfully imported and visible in contacts list
|
||||
- ✅ Error scenarios handled gracefully
|
||||
- ✅ Database operations work correctly
|
||||
- ✅ Logging functions as expected
|
||||
|
||||
## Notes
|
||||
- Test both with and without existing contacts
|
||||
- Verify redirect to contacts page after import
|
||||
- Check success/error notifications display
|
||||
- Validate contact data structure in database
|
||||
212
docs/migration-testing/migration-checklist-ContactImportView.md
Normal file
212
docs/migration-testing/migration-checklist-ContactImportView.md
Normal file
@@ -0,0 +1,212 @@
|
||||
# ContactImportView.vue Migration Testing Checklist
|
||||
|
||||
## Migration Details
|
||||
- **Component**: src/views/ContactImportView.vue
|
||||
- **Migration Date**: 2025-07-06
|
||||
- **Migration Type**: Database Operations + Logging to PlatformServiceMixin
|
||||
- **Priority**: Medium
|
||||
- **Author**: Matthew Raymer
|
||||
|
||||
## Migration Changes
|
||||
- ✅ Removed legacy imports: `logConsoleAndDb`, `databaseUtil`, `PlatformServiceFactory`
|
||||
- ✅ Added PlatformServiceMixin integration
|
||||
- ✅ Converted database operations to mixin methods
|
||||
- ✅ Updated logging to use `this.$logAndConsole()`
|
||||
- ✅ Removed unused helper functions and interfaces
|
||||
|
||||
## Platform Testing Requirements
|
||||
|
||||
### Web Platform Testing
|
||||
|
||||
#### Test URLs for Manual Testing
|
||||
```
|
||||
# Basic contact import page
|
||||
http://localhost:3000/contact-import
|
||||
|
||||
# URL parameter import (single contact)
|
||||
http://localhost:3000/contact-import?contacts=[{"did":"did:test:123","name":"Test User","notes":"Test contact via URL"}]
|
||||
|
||||
# URL parameter import (multiple contacts)
|
||||
http://localhost:3000/contact-import?contacts=[{"did":"did:test:123","name":"Alice"},{"did":"did:test:456","name":"Bob"}]
|
||||
|
||||
# Manual JWT input testing (paste JWT into textarea)
|
||||
http://localhost:3000/contact-import
|
||||
```
|
||||
|
||||
#### Functional Test Cases
|
||||
|
||||
##### 1. Basic Page Load
|
||||
- [ ] Navigate to `/contact-import`
|
||||
- [ ] Page loads without errors
|
||||
- [ ] No console errors displayed
|
||||
- [ ] Manual JWT input textarea is visible
|
||||
- [ ] "Check Import" button is present
|
||||
|
||||
##### 2. URL Parameter Import (Single Contact)
|
||||
- [ ] Navigate to URL with single contact parameter
|
||||
- [ ] Contact displays in import list
|
||||
- [ ] Contact is pre-selected for import
|
||||
- [ ] "Make my activity visible" checkbox is available
|
||||
- [ ] "Import Selected Contacts" button is present
|
||||
|
||||
##### 3. URL Parameter Import (Multiple Contacts)
|
||||
- [ ] Navigate to URL with multiple contacts parameter
|
||||
- [ ] All contacts display in import list
|
||||
- [ ] All contacts are pre-selected for import
|
||||
- [ ] Individual contact selection works
|
||||
- [ ] Bulk import functionality works
|
||||
|
||||
##### 4. Manual JWT Input
|
||||
- [ ] Paste valid JWT into textarea
|
||||
- [ ] Click "Check Import" button
|
||||
- [ ] Valid JWT displays contacts for import
|
||||
- [ ] Invalid JWT shows appropriate error message
|
||||
|
||||
##### 5. Duplicate Contact Detection
|
||||
- [ ] Import contact that already exists
|
||||
- [ ] System detects duplicate correctly
|
||||
- [ ] Shows "Existing" label for duplicate
|
||||
- [ ] Displays field differences (if any)
|
||||
- [ ] Duplicate is not pre-selected for import
|
||||
|
||||
##### 6. Contact Import Process
|
||||
- [ ] Select contacts for import
|
||||
- [ ] Click "Import Selected Contacts"
|
||||
- [ ] Loading indicator appears
|
||||
- [ ] Success message displays
|
||||
- [ ] Redirects to contacts page
|
||||
- [ ] Imported contacts appear in contacts list
|
||||
|
||||
##### 7. Visibility Setting
|
||||
- [ ] Check "Make my activity visible" checkbox
|
||||
- [ ] Import contacts
|
||||
- [ ] Verify visibility is set for imported contacts
|
||||
- [ ] Test with visibility setting disabled
|
||||
|
||||
##### 8. Error Handling
|
||||
- [ ] Test with malformed JWT
|
||||
- [ ] Test with empty JWT
|
||||
- [ ] Test network failure scenarios
|
||||
- [ ] Test with invalid contact data format
|
||||
- [ ] Verify error messages display appropriately
|
||||
|
||||
##### 9. Database Operations Testing
|
||||
- [ ] Import new contacts - verify database insertion
|
||||
- [ ] Update existing contacts - verify database update
|
||||
- [ ] Check contact data persistence after app reload
|
||||
- [ ] Verify contact relationships are maintained
|
||||
|
||||
##### 10. Logging Validation
|
||||
- [ ] Open browser developer tools
|
||||
- [ ] Trigger error scenarios
|
||||
- [ ] Verify errors appear in console with proper formatting
|
||||
- [ ] Check database logs table for stored errors
|
||||
- [ ] Verify log entries include appropriate context
|
||||
|
||||
#### Technical Validation
|
||||
|
||||
##### Browser Developer Tools
|
||||
- [ ] Console shows no errors during normal operation
|
||||
- [ ] Console shows properly formatted error messages when errors occur
|
||||
- [ ] Network tab shows appropriate API calls
|
||||
- [ ] Application tab shows IndexedDB updates
|
||||
|
||||
##### Database Verification
|
||||
- [ ] Open Application > IndexedDB > TimeSafari database
|
||||
- [ ] Verify contacts table updates correctly
|
||||
- [ ] Check logs table for error entries
|
||||
- [ ] Verify data structure matches expected format
|
||||
|
||||
##### Performance Validation
|
||||
- [ ] Page loads within reasonable time
|
||||
- [ ] Import operations complete without freezing UI
|
||||
- [ ] Large contact lists (10+) import efficiently
|
||||
- [ ] No memory leaks during extended use
|
||||
|
||||
### Desktop Platform Testing
|
||||
- [ ] Test Electron app functionality
|
||||
- [ ] Verify database operations work in Electron context
|
||||
- [ ] Test file system access (if applicable)
|
||||
- [ ] Verify native desktop integrations
|
||||
|
||||
### Mobile Platform Testing
|
||||
- [ ] Test iOS app via Capacitor
|
||||
- [ ] Test Android app via Capacitor
|
||||
- [ ] Verify mobile-specific features
|
||||
- [ ] Test deep linking functionality
|
||||
|
||||
## Test Data Templates
|
||||
|
||||
### Single Contact JSON
|
||||
```json
|
||||
[{"did":"did:test:single","name":"Single Test User","notes":"Test contact for single import"}]
|
||||
```
|
||||
|
||||
### Multiple Contacts JSON
|
||||
```json
|
||||
[
|
||||
{"did":"did:test:alice","name":"Alice Johnson","notes":"First test contact"},
|
||||
{"did":"did:test:bob","name":"Bob Smith","notes":"Second test contact"},
|
||||
{"did":"did:test:charlie","name":"Charlie Brown","notes":"Third test contact"}
|
||||
]
|
||||
```
|
||||
|
||||
### Malformed Data (Error Testing)
|
||||
```json
|
||||
[{"invalid":"data","missing":"did"}]
|
||||
```
|
||||
|
||||
## Expected Outcomes
|
||||
|
||||
### Successful Import
|
||||
- Contacts appear in main contacts list
|
||||
- Database contains new contact entries
|
||||
- Success notification displays
|
||||
- Redirect to contacts page occurs
|
||||
|
||||
### Duplicate Handling
|
||||
- Existing contacts show "Existing" label
|
||||
- Field differences are highlighted
|
||||
- User can choose to update or skip
|
||||
- System prevents duplicate entries
|
||||
|
||||
### Error Scenarios
|
||||
- Malformed data shows clear error messages
|
||||
- Network failures are handled gracefully
|
||||
- Invalid JWTs display appropriate warnings
|
||||
- Console logs contain debugging information
|
||||
|
||||
## Sign-Off Checklist
|
||||
|
||||
### Web Platform ✅/❌
|
||||
- [ ] Chrome: Tested by [Name] on [Date]
|
||||
- [ ] Firefox: Tested by [Name] on [Date]
|
||||
- [ ] Safari: Tested by [Name] on [Date]
|
||||
- [ ] Notes: [Any platform-specific issues or observations]
|
||||
|
||||
### Desktop Platform ✅/❌
|
||||
- [ ] Windows: Tested by [Name] on [Date]
|
||||
- [ ] macOS: Tested by [Name] on [Date]
|
||||
- [ ] Linux: Tested by [Name] on [Date]
|
||||
- [ ] Notes: [Any platform-specific issues or observations]
|
||||
|
||||
### Mobile Platform ✅/❌
|
||||
- [ ] iOS: Tested by [Name] on [Date]
|
||||
- [ ] Android: Tested by [Name] on [Date]
|
||||
- [ ] Notes: [Any platform-specific issues or observations]
|
||||
|
||||
### Final Sign-Off
|
||||
- [ ] All platforms tested and working
|
||||
- [ ] No regressions identified
|
||||
- [ ] Performance is acceptable
|
||||
- [ ] Migration completed by: [Name] on [Date]
|
||||
|
||||
## Known Issues/Limitations
|
||||
- Document any known issues discovered during testing
|
||||
- Note any platform-specific limitations
|
||||
- Record any workarounds implemented
|
||||
|
||||
## Notes
|
||||
- Include any additional observations
|
||||
- Record performance metrics if applicable
|
||||
- Note any suggestions for future improvements
|
||||
@@ -160,11 +160,11 @@
|
||||
|
||||
<script lang="ts">
|
||||
/* TODO: Human Testing Required - PlatformServiceMixin Migration */
|
||||
// Priority: High | Migrated: 2025-01-06 | Author: Matthew Raymer
|
||||
//
|
||||
// TESTING NEEDED: Component migrated from legacy logConsoleAndDb to PlatformServiceMixin
|
||||
// Priority: High | Migrated: 2025-07-06 | Author: Matthew Raymer
|
||||
//
|
||||
// TESTING NEEDED: Component migrated from legacy logConsoleAndDb to PlatformServiceMixin
|
||||
// but requires human validation due to meeting component accessibility limitations.
|
||||
//
|
||||
//
|
||||
// Test Scenarios Required:
|
||||
// 1. Load members list with valid meeting password
|
||||
// 2. Test member admission toggle (organizer role)
|
||||
@@ -172,13 +172,12 @@
|
||||
// 4. Test error scenarios: network failure, invalid password, server errors
|
||||
// 5. Verify error logging appears in console and database
|
||||
// 6. Cross-platform testing: web, mobile, desktop
|
||||
//
|
||||
// Reference: docs/migration-checklist-MembersList.md
|
||||
//
|
||||
// Reference: docs/migration-testing/migration-checklist-MembersList.md
|
||||
// Migration Details: Replaced 3 logConsoleAndDb() calls with this.$logAndConsole()
|
||||
// Validation: Passes lint checks and TypeScript compilation
|
||||
// Navigation: Contacts → Chair Icon → Start/Join Meeting → Members List
|
||||
|
||||
|
||||
import { Component, Vue, Prop } from "vue-facing-decorator";
|
||||
|
||||
import {
|
||||
|
||||
@@ -201,9 +201,7 @@ import QuickNav from "../components/QuickNav.vue";
|
||||
import EntityIcon from "../components/EntityIcon.vue";
|
||||
import OfferDialog from "../components/OfferDialog.vue";
|
||||
import { APP_SERVER, AppString, NotificationIface } from "../constants/app";
|
||||
import { logConsoleAndDb } from "../db/index";
|
||||
import { Contact, ContactMethod } from "../db/tables/contacts";
|
||||
import * as databaseUtil from "../db/databaseUtil";
|
||||
import * as libsUtil from "../libs/util";
|
||||
import {
|
||||
capitalizeAndInsertSpacesBeforeCaps,
|
||||
@@ -212,60 +210,7 @@ import {
|
||||
} from "../libs/endorserServer";
|
||||
import { getContactJwtFromJwtUrl } from "../libs/crypto";
|
||||
import { decodeEndorserJwt } from "../libs/crypto/vc";
|
||||
import { PlatformServiceFactory } from "@/services/PlatformServiceFactory";
|
||||
|
||||
/**
|
||||
* Interface for contact data as stored in the database
|
||||
* Differs from Contact interface in that contactMethods is stored as a JSON string
|
||||
*/
|
||||
interface ContactDbRecord {
|
||||
did: string;
|
||||
contactMethods: string;
|
||||
name: string;
|
||||
notes: string;
|
||||
profileImageUrl: string;
|
||||
publicKeyBase64: string;
|
||||
nextPubKeyHashB64: string;
|
||||
seesMe: boolean;
|
||||
registered: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures a value is a string, never null or undefined
|
||||
*/
|
||||
function safeString(val: unknown): string {
|
||||
return typeof val === "string" ? val : val == null ? "" : String(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a Contact object to a ContactDbRecord for database storage
|
||||
* @param contact The contact object to convert
|
||||
* @returns A ContactDbRecord with contactMethods as a JSON string
|
||||
* @throws Error if contact.did is missing or invalid
|
||||
*/
|
||||
function contactToDbRecord(contact: Contact): ContactDbRecord {
|
||||
if (!contact.did) {
|
||||
throw new Error("Contact must have a DID");
|
||||
}
|
||||
|
||||
// Convert contactMethods array to JSON string, defaulting to empty array
|
||||
const contactMethodsStr =
|
||||
contact.contactMethods != null
|
||||
? JSON.stringify(contact.contactMethods)
|
||||
: "[]";
|
||||
|
||||
return {
|
||||
did: safeString(contact.did), // Required field, must be present
|
||||
contactMethods: contactMethodsStr,
|
||||
name: safeString(contact.name),
|
||||
notes: safeString(contact.notes),
|
||||
profileImageUrl: safeString(contact.profileImageUrl),
|
||||
publicKeyBase64: safeString(contact.publicKeyBase64),
|
||||
nextPubKeyHashB64: safeString(contact.nextPubKeyHashB64),
|
||||
seesMe: contact.seesMe ?? false,
|
||||
registered: contact.registered ?? false,
|
||||
};
|
||||
}
|
||||
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
|
||||
|
||||
/**
|
||||
* Contact Import View Component
|
||||
@@ -307,8 +252,29 @@ function contactToDbRecord(contact: Contact): ContactDbRecord {
|
||||
*
|
||||
* @component
|
||||
*/
|
||||
// TODO: Testing Required - Database Operations + Logging Migration to PlatformServiceMixin
|
||||
// Priority: Medium | Migrated: 2025-07-06 | Author: Matthew Raymer
|
||||
//
|
||||
// MIGRATION DETAILS: Migrated from legacy databaseUtil + logConsoleAndDb to PlatformServiceMixin
|
||||
// - Replaced logConsoleAndDb() with this.$logAndConsole()
|
||||
// - Replaced databaseUtil.* calls with mixin methods
|
||||
// - Removed PlatformServiceFactory direct usage in favor of mixin
|
||||
//
|
||||
// TESTING NEEDED: Contact import functionality
|
||||
// 1. Test contact import via URL: /contact-import?contacts=[{"did":"did:example:123","name":"Alice"}]
|
||||
// 2. Test JWT import via URL path: /contact-import/[JWT_TOKEN]
|
||||
// 3. Test manual JWT input via textarea
|
||||
// 4. Test duplicate contact detection and field comparison
|
||||
// 5. Test error scenarios: invalid JWT, malformed data, network issues
|
||||
// 6. Verify error logging appears correctly
|
||||
//
|
||||
// Test URLs:
|
||||
// /contact-import (manual input)
|
||||
// /contact-import?contacts=[{"did":"did:test:123","name":"Test User"}]
|
||||
|
||||
@Component({
|
||||
components: { EntityIcon, OfferDialog, QuickNav },
|
||||
mixins: [PlatformServiceMixin],
|
||||
})
|
||||
export default class ContactImportView extends Vue {
|
||||
/** Notification function injected by Vue */
|
||||
@@ -388,7 +354,7 @@ export default class ContactImportView extends Vue {
|
||||
* Initializes component settings from active account
|
||||
*/
|
||||
private async initializeSettings() {
|
||||
const settings = await databaseUtil.retrieveSettingsForActiveAccount();
|
||||
const settings = await this.$accountSettings();
|
||||
this.activeDid = settings.activeDid || "";
|
||||
this.apiServer = settings.apiServer || "";
|
||||
}
|
||||
@@ -452,13 +418,8 @@ export default class ContactImportView extends Vue {
|
||||
this.contactsImporting = contacts;
|
||||
this.contactsSelected = new Array(this.contactsImporting.length).fill(true);
|
||||
|
||||
const platformService = PlatformServiceFactory.getInstance();
|
||||
const dbAllContacts = await platformService.dbQuery(
|
||||
"SELECT * FROM contacts",
|
||||
);
|
||||
const baseContacts = databaseUtil.mapQueryResultToValues(
|
||||
dbAllContacts,
|
||||
) as unknown as Contact[];
|
||||
// Get all existing contacts for comparison
|
||||
const baseContacts = await this.$getAllContacts();
|
||||
|
||||
// Check for existing contacts and differences
|
||||
for (let i = 0; i < this.contactsImporting.length; i++) {
|
||||
@@ -542,7 +503,7 @@ export default class ContactImportView extends Vue {
|
||||
}
|
||||
} catch (error) {
|
||||
const fullError = "Error importing contacts: " + errorStringForLog(error);
|
||||
logConsoleAndDb(fullError, true);
|
||||
this.$logAndConsole(fullError, true);
|
||||
this.$notify(
|
||||
{
|
||||
group: "alert",
|
||||
@@ -570,30 +531,14 @@ export default class ContactImportView extends Vue {
|
||||
if (this.contactsSelected[i]) {
|
||||
const contact = this.contactsImporting[i];
|
||||
const existingContact = this.contactsExisting[contact.did];
|
||||
const platformService = PlatformServiceFactory.getInstance();
|
||||
|
||||
// Convert contact to database record format
|
||||
const contactToStore = contactToDbRecord(contact);
|
||||
|
||||
if (existingContact) {
|
||||
// Update existing contact
|
||||
const { sql, params } = databaseUtil.generateUpdateStatement(
|
||||
contactToStore as unknown as Record<string, unknown>,
|
||||
"contacts",
|
||||
"did = ?",
|
||||
[contact.did],
|
||||
);
|
||||
await platformService.dbExec(sql, params);
|
||||
|
||||
await this.$updateContact(contact.did, contact);
|
||||
updatedCount++;
|
||||
} else {
|
||||
// Add new contact
|
||||
const { sql, params } = databaseUtil.generateInsertStatement(
|
||||
contactToStore as unknown as Record<string, unknown>,
|
||||
"contacts",
|
||||
);
|
||||
await platformService.dbExec(sql, params);
|
||||
|
||||
await this.$insertContact(contact);
|
||||
importedCount++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
<code>timesafari://{{ formattedPath }}</code>
|
||||
<div class="debug-info">
|
||||
<h4>Parameters:</h4>
|
||||
<pre>{{ JSON.stringify(route.params, null, 2) }}</pre>
|
||||
<pre>{{ JSON.stringify($route.params, null, 2) }}</pre>
|
||||
<h4>Query:</h4>
|
||||
<pre>{{ JSON.stringify(route.query, null, 2) }}</pre>
|
||||
<pre>{{ JSON.stringify($route.query, null, 2) }}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
// TODO: Testing Required - Vue 3 to Options API + PlatformServiceMixin Migration
|
||||
// Priority: Medium | Migrated: 2025-01-06 | Author: Matthew Raymer
|
||||
// Priority: Medium | Migrated: 2025-07-06 | Author: Matthew Raymer
|
||||
//
|
||||
// MIGRATION DETAILS: Converted from Vue 3 Composition API to Options API for PlatformServiceMixin
|
||||
// - Replaced logConsoleAndDb() with this.$logAndConsole()
|
||||
@@ -56,6 +56,7 @@
|
||||
// Test URL: timesafari://invalid/path?param=test
|
||||
|
||||
import { Component, Vue } from "vue-facing-decorator";
|
||||
import { RouteLocationNormalizedLoaded, Router } from "vue-router";
|
||||
import { VALID_DEEP_LINK_ROUTES } from "../interfaces/deepLinks";
|
||||
import { logger } from "../utils/logger";
|
||||
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
|
||||
@@ -64,6 +65,11 @@ import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin";
|
||||
mixins: [PlatformServiceMixin],
|
||||
})
|
||||
export default class DeepLinkErrorView extends Vue {
|
||||
/** Current route instance */
|
||||
$route!: RouteLocationNormalizedLoaded;
|
||||
/** Router instance for navigation */
|
||||
$router!: Router;
|
||||
|
||||
validRoutes = VALID_DEEP_LINK_ROUTES;
|
||||
|
||||
// Extract error information from query params
|
||||
|
||||
Reference in New Issue
Block a user