Skip to content

Conversation

@TaylorBeeston
Copy link
Collaborator

@TaylorBeeston TaylorBeeston commented Dec 19, 2025

Overview

🎟 Relevant Jira Issues

[LC-1495] DID:web cache not invalidating after claiming Boost (Manage Profile)

📚 What is the context and goal of this PR?

There's an annoying bug I've noticed for a while where the did web of a managed profile doesn't
invalidate in Redis after someone claims a boost that allows them to manage that profile. This effectively
means you have to wait until the cache clears before you can actually switch to that profile.

🥴 TL; RL:

This fixes the above issue by querying Neo4j directly to find the boost that a credential is an instance
of in this flow. Somehow there was an issue where it just wasn't correctly finding the right boost
and so not evicting the cache correctly. This is resolved now.

💡 Feature Breakdown (screenshots & videos encouraged!)

🛠 Important tradeoffs made:

An extra query when you claim a credential

🔍 Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Chore (refactor, documentation update, etc)

💳 Does This Create Any New Technical Debt? ( If yes, please describe and add JIRA TODOs )

  • No
  • Yes

Testing

🔬 How Can Someone QA This?

You can just run the tests =)

📱 🖥 Which devices would you like help testing on?

🧪 Code Coverage

Added unit test

Documentation

📝 Documentation Checklist

User-Facing Docs (docs/docs.learncard.com)

  • Tutorial — New capability that users need to learn (docs/tutorials/)
  • How-To Guide — New workflow or integration (docs/how-to-guides/)
  • Reference — New/changed API, config, or SDK method (docs/sdks/)
  • Concept — New mental model or architecture explanation (docs/core-concepts/)
  • App Flows — Changes to LearnCard App or ScoutPass user flows (docs/apps/)

Internal/AI Docs

  • CLAUDE.md — New pattern, flow, or context that AI assistants need
  • Code comments/JSDoc — Complex logic that needs inline explanation

Visual Documentation

  • Mermaid diagram — Complex flow, state machine, or architecture
B[LearnCard] --> C[Network]
-->

#### 💭 Documentation Notes
<!-- If no docs needed, briefly explain why (e.g., "Internal refactor, no API changes") -->
It's not needed, this is a bug fix to make expected behavior happen


# ✅ PR Checklist
- [x] Related to a Jira issue ([create one if not](https://welibrary.atlassian.net/jira/software/projects/WE/boards/2))
- [x] My code follows **style guidelines** (eslint / prettier)
- [x] I have **manually tested** common end-2-end cases
- [x] I have **reviewed** my code
- [x] I have **commented** my code, particularly where ambiguous
- [x] New and existing **unit tests pass** locally with my changes
- [x] I have completed the **Documentation Checklist** above (or explained why N/A)

### 🚀 Ready to squash-and-merge?:
- [x] Code is backwards compatible
- [x] There is **not** a "Do Not Merge" label on this PR
- [x] I have thoughtfully considered the security implications of this change.
- [x] This change does not expose new public facing endpoints that do not have authentication


[LC-1495]: https://welibrary.atlassian.net/browse/LC-1495?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
<!--start_gitstream_placeholder-->
### ✨ PR Description
Purpose: Fix did:web cache invalidation for boost credentials by replacing JSON parsing with database query to reliably retrieve boost IDs when credentials are accepted or claimed.

Main changes:
- Added getBoostIdForCredentialInstance() function to query boost ID from database using Neo4j relationships
- Replaced direct JSON parsing of credential.credential with database lookup in claim hooks and relationship creation
- Added test coverage verifying cache invalidation for managed profiles when accepting boost with canManageChildrenProfiles permission

_Generated by LinearB AI and added by gitStream._
<sub>AI-generated content may contain inaccuracies. Please verify before using.
💡 **Tip:** You can customize your AI Description using **Guidelines** [Learn how](https://docs.gitstream.cm/automation-actions/#describe-changes)</sub>
<!--end_gitstream_placeholder-->

@changeset-bot
Copy link

changeset-bot bot commented Dec 19, 2025

🦋 Changeset detected

Latest commit: 9023a5b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@learncard/network-brain-service Patch
@learncard/network-brain-client Patch
@learncard/network-plugin Patch
@learncard/init Patch
@learncard/chapi-example Patch
@learncard/create-http-bridge Patch
@learncard/cli Patch
@learncard/react Patch
learn-card-discord-bot Patch
@learncard/lca-api-service Patch
learn-card-app Patch
scoutpass-app Patch
@learncard/snap-chapi-example Patch
@learncard/lca-api-client Patch
@learncard/lca-api-plugin Patch
learn-card-base Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for staging-learncardapp ready!

Name Link
🔨 Latest commit 9023a5b
🔍 Latest deploy log https://app.netlify.com/projects/staging-learncardapp/deploys/69459a599c49f200074cfd35
😎 Deploy Preview https://deploy-preview-902--staging-learncardapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for learncarddocs canceled.

Name Link
🔨 Latest commit 9023a5b
🔍 Latest deploy log https://app.netlify.com/projects/learncarddocs/deploys/69459a58a8a65500082e863a

@github-actions
Copy link
Contributor

👋 Hey there! It looks like you modified code, but didn't update the documentation in /docs.

If this PR introduces new features, changes APIs, or modifies behavior that users or developers need to know about, please consider updating the docs.


🏄 Windsurf Tip

You can ask Windsurf to help:

"Analyze the changes in this PR and update the gitbook docs in /docs accordingly."

Windsurf will review your changes and suggest appropriate documentation updates based on what was modified.


📚 Documentation Guide
Change Type Doc Location
New feature/API docs/tutorials/ or docs/how-to-guides/
SDK/API changes docs/sdks/
New concepts docs/core-concepts/
App UI/UX flows docs/apps/ (LearnCard App, ScoutPass)
Internal patterns CLAUDE.md

This is an automated reminder. If no docs are needed, feel free to ignore this message.

Copy link
Contributor

@gitstream-cm gitstream-cm bot left a comment

Choose a reason for hiding this comment

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

✨ PR Review

LGTM

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how

@gitstream-cm
Copy link
Contributor

gitstream-cm bot commented Dec 19, 2025

🥷 Code experts: Custard7, gerardopar

Custard7, gerardopar have most 👩‍💻 activity in the files.
Custard7 has most 🧠 knowledge in the files.

See details

services/learn-card-network/brain-service/src/accesslayer/credential/relationships/create.ts

Activity based on git-commit:

Custard7 gerardopar
DEC
NOV 44 additions & 11 deletions
OCT
SEP
AUG
JUL

Knowledge based on git-blame:
Custard7: 73%

services/learn-card-network/brain-service/src/accesslayer/credential/relationships/read.ts

Activity based on git-commit:

Custard7 gerardopar
DEC
NOV 5 additions & 1 deletions
OCT
SEP
AUG
JUL

Knowledge based on git-blame:
Custard7: 98%

services/learn-card-network/brain-service/src/helpers/claim-hooks.helpers.ts

Activity based on git-commit:

Custard7 gerardopar
DEC
NOV
OCT
SEP
AUG
JUL

Knowledge based on git-blame:
Custard7: 75%

services/learn-card-network/brain-service/test/credentials.spec.ts

Activity based on git-commit:

Custard7 gerardopar
DEC
NOV 51 additions & 0 deletions
OCT
SEP
AUG
JUL

Knowledge based on git-blame:
Custard7: 91%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@TaylorBeeston TaylorBeeston merged commit 0e7c269 into main Dec 19, 2025
27 checks passed
@TaylorBeeston TaylorBeeston deleted the LC-1495-Did-Web-Cache branch December 19, 2025 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants