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

Remix: hard-delete projects #4881

Merged
merged 3 commits into from
Feb 12, 2024
Merged

Remix: hard-delete projects #4881

merged 3 commits into from
Feb 12, 2024

Conversation

ruggi
Copy link
Contributor

@ruggi ruggi commented Feb 12, 2024

Fix #4880

Problem:

#4874 introduced soft-deleted projects that will end up in a Trash or similar concept. Now, we also need a way to destroy (= hard delete) projects as well.

Fix:

  • Added routes and queries to destroy a single project (that was soft-deleted)
  • Added route and queries to destroy all user projects (that were soft-deleted), the equivalent of a Empty the trash concept.
  • Added tests for both.

Note: it's easy to see a future case of soft/hard-deleting a selection of projects, but we can add it later on as a simple incremental change rather than over-engineering now.

Copy link
Contributor

github-actions bot commented Feb 12, 2024

Try me

Copy link

relativeci bot commented Feb 12, 2024

Job #10388: Bundle Size — 61.73MiB (~-0.01%).

14a814f(current) vs d299c8d master#10383(baseline)

Warning

Bundle contains 57 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
Job #10388
     Baseline
Job #10383
Regression  Initial JS 34.78MiB(~+0.01%) 34.78MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 20.46% 20.45%
No change  Chunks 28 28
No change  Assets 32 32
No change  Modules 4294 4294
No change  Duplicate Modules 493 493
No change  Duplicate Code 31.01% 31.01%
No change  Packages 455 455
No change  Duplicate Packages 57 57
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
Job #10388
     Baseline
Job #10383
Regression  JS 61.72MiB (~+0.01%) 61.72MiB
Improvement  HTML 11.37KiB (-0.32%) 11.41KiB

View job #10388 reportView feat/remix-destroy-projects branch activityView project dashboard

Copy link
Contributor

github-actions bot commented Feb 12, 2024

Performance test results:
(Chart1)
(Chart2)


await fn()
const got = await prisma.project.findMany({ where: { owner_id: 'bob' } })
expect(got.map((p) => p.proj_id)).toEqual(['one', 'four', 'five'])
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add an expect for the projects that aren't owned by 'bob' please to ensure we haven't accidentally deleted anyone else's projects (soft deleted or otherwise)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's already ensure here

const aliceProjects = await prisma.project.findMany({ where: { owner_id: 'alice' } })
but I can add it here too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ruggi ruggi merged commit da77530 into master Feb 12, 2024
16 checks passed
@ruggi ruggi deleted the feat/remix-destroy-projects branch February 12, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remix: hard delete projects
3 participants