Skip to content

Respect query strings (cachebusting) - #118

Merged
peterwilsoncc merged 8 commits into
developfrom
fix/26-cache-busting-string
Jan 8, 2023
Merged

Respect query strings (cachebusting)#118
peterwilsoncc merged 8 commits into
developfrom
fix/26-cache-busting-string

Conversation

@peterwilsoncc

@peterwilsoncc peterwilsoncc commented Dec 13, 2022

Copy link
Copy Markdown
Contributor

Description of the Change

Displays the ads.txt and app-ads.txt files for any URL beginning with (app-)ads.txt? -- this is to account for requests that include a querystring.

The value of the query string has no affect to emulate the affect of hitting an actual text file.

Closes #26.

How to test the Change

Changelog Entry

Fixed - Display ads.txt files for crawlers using a cache busting query string.

Credits

Props @helen, @peterwilsoncc.

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@peterwilsoncc
peterwilsoncc force-pushed the fix/26-cache-busting-string branch from ac59d46 to 0861560 Compare December 13, 2022 04:04
@peterwilsoncc
peterwilsoncc marked this pull request as ready for review December 13, 2022 04:08
@peterwilsoncc
peterwilsoncc requested review from a team and Sidsector9 and removed request for a team December 13, 2022 04:08
@peterwilsoncc peterwilsoncc self-assigned this Dec 13, 2022
@peterwilsoncc peterwilsoncc added this to the 1.5.0 milestone Dec 13, 2022
@peterwilsoncc
peterwilsoncc requested review from cadic and removed request for Sidsector9 December 13, 2022 05:40

@cadic cadic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@peterwilsoncc Nice job with tests!

I have just one concern about the initial state before assertions. When you testing the cache-busting scenario, you expect that the database already has a correct record set up. It works in this particular situation because previous tests have saved the correct record. But you made your tests rely on other tests results https://docs.cypress.io/guides/references/best-practices#Having-tests-rely-on-the-state-of-previous-tests

So if someone will insert a new test just before yours (which is OK), and their test will save some data that your test doesn't expect (which is OK too)... Your test will fail and this is not a responsibility of that person. So it will be great to save the database record in the beginning of your test.

@peterwilsoncc

Copy link
Copy Markdown
Contributor Author

@cadic Thanks for the review.

I ended up combining the querystring tests with the previous test to avoid the need to repeat setting up the code. There's a section on the best practices guide pointing out the difference between E2E and unit tests. It argues for grouping similar assertions.

@jeffpaul
jeffpaul requested a review from cadic December 22, 2022 23:04

@cadic cadic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the updates @peterwilsoncc

@peterwilsoncc
peterwilsoncc merged commit 5d14449 into develop Jan 8, 2023
@peterwilsoncc
peterwilsoncc deleted the fix/26-cache-busting-string branch January 8, 2023 21:51
@dkotter dkotter modified the milestones: 1.5.0, 1.4.2 Jan 13, 2023
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.

Respect query strings (cachebusting)

3 participants