fix(settings): resolve server switching not applying immediately

- Fix database query logic in PlatformServiceMixin.$getSettings() to properly
  distinguish between master settings (ID) and account settings (DID)
- Add comprehensive logging for settings debugging with request IDs and
  component tracking
- Fix ProfileService initialization order in AccountViewView to use correct
  partnerApiServer after settings load
- Add URL flow testing interface in TestView for debugging server switching
- Enhance settings consistency validation and error handling

Resolves issue where profile server changes were saved but not applied due to
incorrect database query logic and settings priority handling.

Files changed: PlatformServiceMixin.ts, AccountViewView.vue, TestView.vue,
TopMessage.vue, main.ts, router/index.ts

Testing: Added comprehensive URL flow testing interface for validation
This commit is contained in:
Matthew Raymer
2025-08-25 09:57:13 +00:00
parent e70faff5ce
commit fd30343ec4
5 changed files with 517 additions and 23 deletions

View File

@@ -58,7 +58,10 @@
v-if="!isRegistered"
:passkeys-enabled="PASSKEYS_ENABLED"
:given-name="givenName"
message="Before you can publicly announce a new project or time commitment, a friend needs to register you."
:message="
`Before you can publicly announce a new project or time commitment, ` +
`a friend needs to register you.`
"
/>
<!-- Notifications -->
@@ -925,7 +928,10 @@ export default class AccountViewView extends Vue {
// This prevents the "Cannot read properties of undefined (reading 'Default')" error
if (L.Icon.Default) {
// Type-safe way to handle Leaflet icon prototype
const iconDefault = L.Icon.Default.prototype as Record<string, unknown>;
const iconDefault = L.Icon.Default.prototype as unknown as Record<
string,
unknown
>;
if ("_getIconUrl" in iconDefault) {
delete iconDefault._getIconUrl;
}
@@ -947,14 +953,25 @@ export default class AccountViewView extends Vue {
* @throws Will display specific messages to the user based on different errors.
*/
async mounted(): Promise<void> {
this.profileService = createProfileService(
this.axios,
this.partnerApiServer,
);
try {
await this.initializeState();
await this.processIdentity();
// FIXED: Create ProfileService AFTER settings are loaded to get correct partnerApiServer
this.profileService = createProfileService(
this.axios,
this.partnerApiServer,
);
logger.info(
"[AccountViewView] ✅ ProfileService created with correct partnerApiServer:",
{
partnerApiServer: this.partnerApiServer,
component: "AccountViewView",
timestamp: new Date().toISOString(),
},
);
if (this.isRegistered) {
try {
const profile = await this.profileService.loadProfile(this.activeDid);