Skip to content

fix: ensure courses can be shared correctly and display the right author - #1968

Open
its-gabo wants to merge 3 commits into
stagingfrom
gs_fix_sharing_course_failing_and_showing_wrong_author
Open

its-gabo wants to merge 3 commits into
stagingfrom
gs_fix_sharing_course_failing_and_showing_wrong_author

Conversation

@its-gabo

@its-gabo its-gabo commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Overview

Fixes course sharing failures when a target tenant already contains a matching category under a different locale.

Also ensures shared courses display the original source-course author instead of the local target-tenant user assigned as the technical course owner. The export snapshot now normalizes author metadata, fills missing metadata from the source author, and supports existing exported courses whose metadata was stored as a double-encoded JSONB string.

The master-course E2E coverage now verifies that:

  • author metadata is copied to the exported course;
  • the target tenant's /api/course/all response displays the source author;
  • the exported course remains read-only.

Business Value

Administrators can reliably share courses between tenants without exports failing because of localized category differences. Recipients also see the actual course author across course listings instead of an unrelated administrator from their own tenant, preserving correct attribution and avoiding confusion.

@its-gabo
its-gabo requested a review from Japrolol September 9, 2026 08:48
@its-gabo its-gabo self-assigned this Sep 9, 2026
@its-gabo its-gabo added the review me 👀 PR is ready to be reviewed label Sep 9, 2026
@its-gabo
its-gabo marked this pull request as ready for review September 9, 2026 08:48
@Japrolol

Copy link
Copy Markdown
Collaborator

Please check if you can use a migration to fix stored data rather than normalize on every read

@its-gabo
its-gabo force-pushed the gs_fix_sharing_course_failing_and_showing_wrong_author branch from ceef927 to c480b73 Compare September 17, 2026 07:58

async findCategoryByLocalizedTitle(title: string) {
const [existingCategory] = await this.db
.select(getTableColumns(categories))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
.select(getTableColumns(categories))
.select()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review me 👀 PR is ready to be reviewed run E2E tests ⚙️ Trigger E2E tests run on this branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants