Closed pdeharo333 closed 2 years ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
staging-tiny-news-sites | ✅ Ready (Inspect) | Visit Preview | Sep 29, 2022 at 6:23PM (UTC) |
Project | TNC Front-End |
Status | Passed |
Commit | c9239db7b2 ℹ️ |
Started | Sep 29, 2022 6:13 PM |
Ended | Sep 29, 2022 6:18 PM |
Duration | 04:30 💡 |
OS | Linux Ubuntu - 20.04 |
Browser | Firefox 104 |
View run in Cypress Dashboard ➡️
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard
Thanks for the feedback. I checked in the changes into staging and confirmed it worked. Only published newsletters are being saved in Hasura and posted to archive page. I created newsletters in 'draft' 'scheduled' 'review' and 'published' and also checked in Hasura. If you'd like, you can run an additional test but otherwise it should be good for prod.
Context of the issue: It has been noted by several folks that their scheduled/in review newsletter has been published to the archive newsletter page after a redeployment. This is happening because the script of 'build-newsletter-edition' on line 96 is pulling any newsletter with a date attached (even a future date) and saving it to Hasura. Then when vercel is redeployed it thinks that the newsletter saved in Hasura is published, and adds it to the archive page. In Hasura you can see newsletters that are scheduled but not published saved. The exemption are newsletters in draft (I believe because there is not date attached to it unlike when you schedule one).
Using unit testing and replacing the if statement on line 96 to use the 'newsletter.publicationStatus' variable I was able to see console.log that were saving newsletters not published. This is all based on the console logs
for reference: Publication status of results to include (1 = published; 2 = scheduled; 4 = review; 6 = all statuses)
My testing included running the original code with the date with this condition: (!newsletter.publicationDate) I noted that the console logs were saving newsletters in Hasura that were 2: scheduled or 4: in review.
After updating the code with the condition the logs are displaying that they are not saving in Hasura unless they are '1: published.' There may need to be an additional test to see how they are actually saving in Hasura since this is based on logs but I also think maybe we could push to staging as a test?