Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: message ids, flag and modify tables #145

Merged
merged 5 commits into from
Sep 18, 2024
Merged

fix: message ids, flag and modify tables #145

merged 5 commits into from
Sep 18, 2024

Conversation

mantagen
Copy link
Collaborator

Description

  • fix issue where moderations and lesson snapshots were referencing user messages (which differed to the message ids referenced by in app feedbacks)
    • after this work goes in i'll put in a migration to fix the old instances of the issue
  • adds columns to modifications table so that we're storing
    • 'text' when action is 'other'
    • the path and value of the section being modified
  • adds columns to the flag table so that we're storing
    • the path and value of the section being flagged

Copy link

vercel bot commented Sep 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
oak-ai-lesson-assistant ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2024 1:43pm

Copy link

github-actions bot commented Sep 18, 2024

Playwright e2e tests

Job summary

Download report

To view traces locally, unzip the report and run:

npx playwright show-report ~/Downloads/playwright-report

@@ -0,0 +1,124 @@
import * as Sentry from "@sentry/nextjs";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Mostly moves the file into its own router


if (vercelUrl?.includes("production")) {
return "labs.thenational.academy";
if (vercelEnv === "production") {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Realised this was still returning a preview URL before

userId String @map("user_id")
chatId String @map("chat_id")
messageId String @map("message_id")
textForMod String? @map("text_for_mod")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Made this nullable, will remove in a subsequent migration, as it's not storing meaningful data

Copy link
Contributor

Choose a reason for hiding this comment

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

why not just remove now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cause if i remove it before the code changes are in ... then someone will flag something, it will try to add textForMod and it will fail.

This way the migrations and the code don't have to go in at theexact saem time

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
19.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

ALTER TABLE "aila_user_modifications" ADD COLUMN "action_other_text" TEXT,
ADD COLUMN "section_path" TEXT,
ADD COLUMN "section_value" JSONB,
ALTER COLUMN "text_for_mod" DROP NOT NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

🚨 run migrations stg reminder

@mantagen mantagen merged commit 2d347eb into main Sep 18, 2024
16 of 17 checks passed
@mantagen mantagen deleted the fix/flag-modify branch September 18, 2024 14:45
@oak-machine-user
Copy link
Collaborator

🎉 This PR is included in version 1.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants