Skip to content

Fix revocation badge#1822

Open
PatStLouis wants to merge 6 commits intomainfrom
fix-revocation-badge
Open

Fix revocation badge#1822
PatStLouis wants to merge 6 commits intomainfrom
fix-revocation-badge

Conversation

@PatStLouis
Copy link
Contributor

No description provided.

Signed-off-by: Patrick St-Louis <patrick.st-louis@opsecid.ca>
@github-actions
Copy link

@PatStLouis PatStLouis marked this pull request as draft January 26, 2026 21:20
Signed-off-by: Patrick St-Louis <patrick.st-louis@opsecid.ca>
Signed-off-by: Patrick St-Louis <patrick.st-louis@opsecid.ca>
Signed-off-by: Patrick St-Louis <patrick.st-louis@opsecid.ca>
@PatStLouis PatStLouis marked this pull request as ready for review January 28, 2026 00:23
@PatStLouis PatStLouis marked this pull request as draft January 28, 2026 00:26
Signed-off-by: Patrick St-Louis <patrick.st-louis@opsecid.ca>
Signed-off-by: Patrick St-Louis <patrick.st-louis@opsecid.ca>
@PatStLouis PatStLouis marked this pull request as ready for review February 2, 2026 19:16
@esune esune requested review from Copilot, esune and loneil March 2, 2026 23:42
@esune
Copy link
Member

esune commented Mar 2, 2026

@PatStLouis this has become stale - do you mind refreshing it so we can review/merge please?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the tenant UI’s credential revocation flow (and related display formatting) to better track exchanges and refresh state, while also aligning AnonCreds schema storage behavior and bumping the underlying ACA-Py agent version.

Changes:

  • Prefer cred_ex_id for revocation requests and include credential_exchange_id in issued-credential table rows.
  • Improve connection display name resolution by falling back to their_label when alias is missing.
  • Update AnonCreds schema creation/storage flow and upgrade acapy-agent + Docker base image from 1.5.0rc0 to 1.5.0.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
services/tenant-ui/frontend/src/store/issuerStore.ts Simplifies revocation endpoint selection and refreshes credential list after revocation.
services/tenant-ui/frontend/src/store/governanceStore.ts Removes manual schema-storage fallback and relies on backend event handling + delayed refresh.
services/tenant-ui/frontend/src/store/connectionStore.ts Updates connection name lookup to fall back to their_label.
services/tenant-ui/frontend/src/helpers/tableFormatters.ts Adds credential_exchange_id and improves connection name formatting for issued credentials.
services/tenant-ui/frontend/src/components/issuance/credentials/RevokeCredentialForm.vue Builds revocation payload using cred_ex_id when available; removes format-detection logic.
services/tenant-ui/frontend/src/components/connections/Connections.vue Uses `alias
plugins/traction_innkeeper/traction_innkeeper/v1_0/schema_storage/schema_storage_service.py Makes AnonCreds schema-finished event subscription unconditional and normalizes handling.
plugins/traction_innkeeper/pyproject.toml Bumps acapy-agent dependency to 1.5.0.
plugins/traction_innkeeper/poetry.lock Locks updated acapy-agent version and transitive dependency ranges.
plugins/docker/Dockerfile Updates ACA-Py agent container tag to py3.13-1.5.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +118 to 126
error.value = err;
throw err;
}

console.log('< issuerStore.revokeCredential');

if (error.value != null) {
// throw error so $onAction.onError listeners can add their own handler
const errToThrow = error.value;
throw errToThrow;
}
// return data so $onAction.after listeners can add their own handler
return result;
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if (error.value != null) block is redundant here: the only assignment to error.value inside this action is in the inner catch, and that branch immediately re-throws, so execution won’t reach this check with error.value set. Consider simplifying the control flow by removing the extra error.value check (and potentially the nested try/catch) to reduce dead/duplicated error-handling paths.

Copilot uses AI. Check for mistakes.
Comment on lines +596 to 599
// Wait a moment for the backend event handler to process and store the schema
await new Promise((resolve) => setTimeout(resolve, 500));
// Refresh the schema list to show the newly created schema
await listStoredSchemas();
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createAnoncredsSchema now relies on a fixed 500ms delay followed by a single listStoredSchemas() refresh. Since schema storage is handled asynchronously by a backend event handler, this can still race (event processing >500ms) and the newly created schema may not appear until a later manual refresh. Consider polling listStoredSchemas() until the new schema is present (with a timeout), or having the backend return/emit a definitive completion signal to avoid timing-based UI flakiness.

Suggested change
// Wait a moment for the backend event handler to process and store the schema
await new Promise((resolve) => setTimeout(resolve, 500));
// Refresh the schema list to show the newly created schema
await listStoredSchemas();
// Poll for a short period to give the backend event handler time
// to process and store the schema before refreshing the list.
const maxAttempts = 10;
const delayMs = 500;
for (let attempt = 0; attempt < maxAttempts; attempt++) {
// Refresh the schema list to show the newly created schema
await listStoredSchemas();
// If more attempts remain, wait before the next poll
if (attempt < maxAttempts - 1) {
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
}

Copilot uses AI. Check for mistakes.
Comment on lines 16 to +17
python = "^3.13"
acapy-agent = { version = "1.5.0rc0" }
acapy-agent = { version = "1.5.0" }
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR title is focused on a UI revocation badge fix, but this change also upgrades acapy-agent from an RC to 1.5.0 (plus corresponding Docker image/lockfile changes) and adjusts schema event subscription behavior. If these are required for the badge fix, it would help to mention that in the PR description; otherwise consider splitting the dependency/runtime upgrade into a separate PR to keep scope and rollback surface smaller.

Copilot uses AI. Check for mistakes.
Comment on lines 269 to +277
def subscribe(bus: EventBus):
# Subscribe to Indy schema events
bus.subscribe(INDY_SCHEMA_EVENT_PATTERN, schemas_event_handler)
# Subscribe to AnonCreds schema events if available
# Explicitly compile as literal pattern to ensure it's a Pattern object, not a string
if ANONCREDS_SCHEMA_FINISHED_EVENT:
bus.subscribe(
re.compile(re.escape(ANONCREDS_SCHEMA_FINISHED_EVENT)),
schemas_event_handler,
)
# Subscribe to AnonCreds schema finished events
# Use exact match pattern - escape special chars and anchor to start/end
bus.subscribe(
re.compile(f"^{re.escape(ANONCREDS_SCHEMA_FINISHED_EVENT)}$"),
schemas_event_handler,
)
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subscribe() now unconditionally adds a second subscription for ANONCREDS_SCHEMA_FINISHED_EVENT with a newly constructed anchored regex. There are existing unit tests for subscribe(), but they only assert the Indy subscription and would not catch regressions in the AnonCreds subscription (e.g., wrong pattern/handler). Consider extending test_subscribe to assert that the event bus is also subscribed for the AnonCreds schema-finished topic with the expected handler.

Copilot uses AI. Check for mistakes.
async function revokeCredential(payload?: RevokeRequest) {
error.value = null;
loading.value = true;

Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revokeCredential accepts an optional payload, but revocation requests are not meaningful without at least one identifier (e.g., cred_ex_id or rev_reg_id + cred_rev_id). Making this parameter optional makes it easy to accidentally call this action with no data (which would post {} due to the API wrapper’s default), leading to a confusing backend 4xx. Consider making payload required and/or validating required fields up-front and throwing a clear error before calling the API.

Suggested change
// Validate payload before making the API call to avoid sending an empty or meaningless request.
if (!payload) {
loading.value = false;
throw new Error(
'Revoke request payload is required and must include either "cred_ex_id" or both "rev_reg_id" and "cred_rev_id".'
);
}
const hasCredExId =
typeof (payload as any).cred_ex_id === 'string' &&
(payload as any).cred_ex_id.trim().length > 0;
const hasRevRegAndCredRevId =
typeof (payload as any).rev_reg_id === 'string' &&
(payload as any).rev_reg_id.trim().length > 0 &&
typeof (payload as any).cred_rev_id === 'string' &&
(payload as any).cred_rev_id.trim().length > 0;
if (!hasCredExId && !hasRevRegAndCredRevId) {
loading.value = false;
throw new Error(
'Invalid revoke request: provide either "cred_ex_id" or both "rev_reg_id" and "cred_rev_id".'
);
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants