Skip to content

Review and update week06 content#202

Open
JamieBort wants to merge 9 commits intoCode-the-Dream-School:mainfrom
JamieBort:review-test-evaluate-week06
Open

Review and update week06 content#202
JamieBort wants to merge 9 commits intoCode-the-Dream-School:mainfrom
JamieBort:review-test-evaluate-week06

Conversation

@JamieBort
Copy link

@JamieBort JamieBort commented Feb 12, 2026

Addresses #96

Summary

  1. The lesson and assignment files are very well written.

    It flowed and appears to be comprehensive.

    For the most part my edits are solely formatting and a few rephrasing changes.

    The changes that were coding in nature are highlighted below in the "Changes Made" section.

    One of @jrmcgarvey's concerns (from a discussion in a Slack DM) is if the lesson is "too hard or too long". In my opinion, relative to the Node Express lessons in V3, this lesson is neither too hard nor too long. That said there is a lot of content that is covered in this lesson. But CtD is a boot camp. As such, there will necessarily be content that will need to be revisited even after the course is over. That's the nature of software boot camps. In spite of that, there is not too much content that is covered in this lesson.

  2. I did not test the assignment. I believe I didn't create the files in the correct directory.

    So when I ran npm run tdd assignment6, the TDD tests did not run. I attempted to modify the command.

    And I attempted to move the files into the assignment6 directory. But to no avail.

    I would like to be as complete as posible for the associated Issue.

    If someone wouldn't mind assisting me with my file structure, I will gladly run those tests.

  3. WRT this comment in the Issue, a few items are still outstanding. For completeness I want to make sure they're addressed. If/when one of these should be addressed, I'll gladly update the PR with those changes.

    1. the suggestion to Include a short example showing a prisma.user.findUnique query using include: { tasks: true } to demonstrate relationships.

      For sake of brevity I opted not add that example to lesson.

      Also because there is already an exercise where the students create a method to find all the tasks.

      That said, I will gladly add the example if you'd like.

    2. the suggestion to Add a reminder to explicitly run psql -f schema.sql to create tables before testing

      I THINK this is addressed with this command found in the instructions: DATABASE_URL=<TEST_DATABASE_URL> npx prisma migrate reset

      Plus, we're no longer using Postgres/psql commands.

    3. the suggestion to Simplify the SSL configuration note — most local setups do not need ssl: { rejectUnauthorized: false }.

      There is no reference to ssl in either the lesson nor the assignment. I did not do anything with that comment.

    4. the suggestion to Recommend using await pool.end() when stopping the app to close connections cleanly.

      pool is being supplanted by Prisma. All code referencing it is being removed.

    5. the suggestion to Add a short example showing expected Postman requests and responses for /health and /api/users/register.

      This is already addressed in a previous lessons.

Outstanding questions to address

  1. Here it says Then, change the shutdown so that as well as ending the pg pool, it also does the following:.

    What exactly is "it also does the following:" referring to? Because immediately after that statement there are two lines of code and no explanation.

    The code that follows the quoted statement above:

    await prisma.$disconnect();
    console.log("Prisma disconnected");

Changes Made

  1. I updated the instructions pertaining to "Update the Show Method"

    prisma.tasks.findUnique() does not throw a P2025 error when no record is found. It simply returns null.

    The P2025 error only occurs with operations that modify data (update, delete, updateMany, etc.) when no matching record exists.

    Per the Prisma documentation, "By default, both operations return null if the record is not found."

    It is also already addressed in the curriculum lesson.

  2. Multiple times I had to use user_id in place of userId. And is_completed in place of isCompleted.

    I THINK this is contrary to the instructions in the assignment.

    I was able to successfully use the app via Postman. See my controllers/taskController.js file.

  3. Every time we're instructed to use await prisma.task.<some_method> in the assignment, I had to use await prisma.tasks.<some_method> instead.

    On account of my schema.prisma file had tasks rather than task:

    model tasks {
      id           Int      @id @default(autoincrement())
      title        String   @db.VarChar(255)
      is_completed Boolean  @default(false)
      user_id      Int
      created_at   DateTime @default(now()) @db.Timestamp(6)
      users        users    @relation(fields: [user_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
    
      @@unique([id, user_id], map: "task_id_user_id_unique")
    }
    

    Likewise for const user = await prisma.users.findUnique( for the same reason.

    For what it is worth, the instructions to create the SQL database is found here in the repo (in Assignment 5). There the tables users and tasks.

@JamieBort
Copy link
Author

JamieBort commented Feb 19, 2026

EDITS TO THE BODY OF THE PR ABOVE:

  1. I updated 1. under Summary above to add a comment about the length and difficulty of the lesson.
  2. I added 3. under Summary above.

@JamieBort JamieBort marked this pull request as draft February 19, 2026 18:20
@JamieBort JamieBort marked this pull request as ready for review February 19, 2026 19:44
@GinaCastromonte
Copy link
Collaborator

Thanks so much for taking the time to go through the lesson so thoroughly! I haven’t had a chance yet to fully review all of the changes you made, but I really appreciate the time and effort you put into this.

For the suggestions mentioned in the issue, here are the thoughts on each one.

i. Include a short example showing prisma.user.findUnique with include: { tasks: true }

Yes, it would be great to add a small example of this in the lesson. Just a short snippet showing how Prisma can include related records would help reinforce the relationships concept. If you don't have the time let me know and I can ask someone to jump in.

ii. Add a reminder to explicitly run psql -f schema.sql

We can leave this one for now. The instructions already include DATABASE_URL=<TEST_DATABASE_URL> npx prisma migrate reset, and since we are no longer using manual Postgres psql commands, I think an extra reminder is probably not necessary.

iii. Simplify the SSL configuration note

This is already discussed in Lesson 5, so I don't think anything additional needs to be added here.

iv. Recommend using await pool.end() when stopping the app

This was already covered in Lesson 5. In Lesson 6, we move away from pg and switch to await prisma.$disconnect() instead.

v. Add example Postman requests and responses for /health and /api/users/register

These examples are already included in earlier lessons, so we do not need to repeat them here.

The note about “Then, change the shutdown so that as well as ending the pg pool…” was referring to the transition from pool.end() in Lesson 5 to prisma.$disconnect() in Lesson 6 when shutting down the app, which is already included in the lesson.

Also, I’ll attach a repo from a past student that shows how the file structure should look by Lesson 6. That should help with getting the tests to run correctly when using npm run tdd assignment6 ( https://github.com/pleaseHelpImDumb/node-homework/tree/assignment6).

One other small note in case it helps: there may have been some updates to the repo since you last pulled. It might be helpful to run git pull upstream main to make sure everything is up to date before running the tests.

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.

2 participants