fix: remaining starred-project issues, plus better Error logging and user verbiage

This commit is contained in:
2025-09-28 19:07:48 -06:00
parent b3112a4086
commit ee587ac3fc
12 changed files with 103 additions and 135 deletions

View File

@@ -1453,9 +1453,6 @@ export default class AccountViewView extends Vue {
if (imageResp && imageResp.status === 200) {
this.imageLimits = imageResp.data;
} else {
this.limitsMessage = ACCOUNT_VIEW_CONSTANTS.LIMITS.NO_IMAGE_ACCESS;
this.notify.warning(ACCOUNT_VIEW_CONSTANTS.LIMITS.CANNOT_UPLOAD_IMAGES);
}
const endorserResp = await fetchEndorserRateLimits(
@@ -1466,9 +1463,6 @@ export default class AccountViewView extends Vue {
if (endorserResp.status === 200) {
this.endorserLimits = endorserResp.data;
} else {
this.limitsMessage = ACCOUNT_VIEW_CONSTANTS.LIMITS.NO_LIMITS_FOUND;
this.notify.warning(ACCOUNT_VIEW_CONSTANTS.LIMITS.BAD_SERVER_RESPONSE);
}
} catch (error) {
this.limitsMessage =

View File

@@ -223,7 +223,7 @@ export default class ContactAmountssView extends Vue {
const contact = await this.$getContact(contactDid);
this.contact = contact;
const settings = await this.$settings();
const settings = await this.$accountSettings();
// Get activeDid from active_identity table (single source of truth)
// eslint-disable-next-line @typescript-eslint/no-explicit-any

View File

@@ -421,6 +421,18 @@ export default class HomeView extends Vue {
numNewOffersToUser: number = 0; // number of new offers-to-user
numNewOffersToUserProjects: number = 0; // number of new offers-to-user's-projects
numNewStarredProjectChanges: number = 0; // number of new starred project changes
starredPlanHandleIds: Array<string> = []; // list of starred project IDs
searchBoxes: Array<{
name: string;
bbox: BoundingBox;
}> = [];
showShortcutBvc = false;
userAgentInfo = new UAParser(); // see https://docs.uaparser.js.org/v2/api/ua-parser-js/get-os.html
selectedImage = "";
isImageViewerOpen = false;
showProjectsDialog = false;
/**
* CRITICAL VUE REACTIVITY BUG WORKAROUND
*
@@ -458,18 +470,6 @@ export default class HomeView extends Vue {
// return shouldShow;
// }
numNewStarredProjectChanges: number = 0; // number of new starred project changes
starredPlanHandleIds: Array<string> = []; // list of starred project IDs
searchBoxes: Array<{
name: string;
bbox: BoundingBox;
}> = [];
showShortcutBvc = false;
userAgentInfo = new UAParser(); // see https://docs.uaparser.js.org/v2/api/ua-parser-js/get-os.html
selectedImage = "";
isImageViewerOpen = false;
showProjectsDialog = false;
/**
* Initializes notification helpers
*/
@@ -734,7 +734,7 @@ export default class HomeView extends Vue {
* Used for displaying contact info in feed and actions
*
* @internal
* Called by mounted() and initializeIdentity()
* Called by initializeIdentity()
*/
private async loadContacts() {
this.allContacts = await this.$contacts();
@@ -748,7 +748,6 @@ export default class HomeView extends Vue {
* Triggers updateAllFeed() to populate activity feed
*
* @internal
* Called by mounted()
*/
private async loadFeedData() {
await this.updateAllFeed();
@@ -762,7 +761,6 @@ export default class HomeView extends Vue {
* - Rate limit status for both
*
* @internal
* Called by mounted() and initializeIdentity()
* @requires Active DID
*/
private async loadNewOffers() {
@@ -873,7 +871,6 @@ export default class HomeView extends Vue {
* - Rate limit status for starred project changes
*
* @internal
* Called by mounted() and initializeIdentity()
* @requires Active DID
*/
private async loadNewStarredProjectChanges() {

View File

@@ -170,7 +170,7 @@
</div>
</div>
<a class="cursor-pointer" @click="onClickLoadClaim(projectId)">
<a class="cursor-pointer" @click="onClickLoadClaim(jwtId)">
<font-awesome icon="file-lines" class="pl-2 pt-1 text-blue-500" />
</a>
</div>
@@ -303,10 +303,7 @@
{{ offer.objectDescription }}
</div>
<div class="flex justify-between">
<a
class="cursor-pointer"
@click="onClickLoadClaim(offer.jwtId as string)"
>
<a class="cursor-pointer" @click="onClickLoadClaim(offer.jwtId)">
<font-awesome
icon="file-lines"
class="pl-2 pt-1 text-blue-500"
@@ -606,7 +603,6 @@ import { AxiosError } from "axios";
import { Component, Vue } from "vue-facing-decorator";
import VueMarkdown from "vue-markdown-render";
import { Router } from "vue-router";
import { useClipboard } from "@vueuse/core";
import {
GenericVerifiableCredential,
@@ -746,6 +742,8 @@ export default class ProjectViewView extends Vue {
} | null = null;
/** DIDs that can see issuer information */
issuerVisibleToDids: Array<string> = [];
/** Project JWT ID */
jwtId = "";
/** Project location data */
latitude = 0;
loadingTotals = false;
@@ -910,6 +908,7 @@ export default class ProjectViewView extends Vue {
this.allContacts,
);
this.issuerVisibleToDids = resp.data.issuerVisibleToDids || [];
this.jwtId = resp.data.id;
this.name = resp.data.claim?.name || "(no name)";
this.description = resp.data.claim?.description || "";
this.truncatedDesc = this.description.slice(0, this.truncateLength);
@@ -1509,11 +1508,10 @@ export default class ProjectViewView extends Vue {
if (!this.projectId) return;
try {
const settings = await this.$accountSettings();
const starredIds = settings.starredPlanHandleIds || [];
if (!this.isStarred) {
// Add to starred projects
const settings = await databaseUtil.retrieveSettingsForActiveAccount();
const starredIds = settings.starredPlanHandleIds || [];
if (!starredIds.includes(this.projectId)) {
const newStarredIds = [...starredIds, this.projectId];
const newIdsParam = JSON.stringify(newStarredIds);
@@ -1526,20 +1524,16 @@ export default class ProjectViewView extends Vue {
this.isStarred = true;
} else {
// eslint-disable-next-line no-console
console.log(
"Still getting a bad result from SQL update to star a project.",
);
logger.error("Got a bad result from SQL update to star a project.");
}
}
if (!settings.lastAckedStarredPlanChangesJwtId) {
await databaseUtil.updateDidSpecificSettings(this.activeDid, {
lastAckedStarredPlanChangesJwtId: settings.lastViewedClaimId,
lastAckedStarredPlanChangesJwtId: this.jwtId,
});
}
} else {
// Remove from starred projects
const settings = await databaseUtil.retrieveSettingsForActiveAccount();
const starredIds = settings.starredPlanHandleIds || [];
const updatedIds = starredIds.filter((id) => id !== this.projectId);
const newIdsParam = JSON.stringify(updatedIds);