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

🐛 Fixed free tier showing in the tiers-only paywall in posts #19807

Merged
merged 14 commits into from Mar 6, 2024

Conversation

sagzy
Copy link
Contributor

@sagzy sagzy commented Mar 6, 2024

refs INC-36
fixes #19796

  • The tiers-only paywall was incorrectly rendering "Free". Example: "This post is for subscribers of the Free, Silver and Gold tiers only"
  • Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be showing only the paid tiers
  • This fix filters out the "free" tier when visibility is set to tiers, before updating a Post or a Page. The fix includes bulk updates from the list of Posts and Pages (right-click on a Post/Page > Change Access).

refs INC-36

- The tiers-only paywall was incorrectly rendering "Free". Example: "This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers, before updating a Post. It also throws a loud error when using the bulkEdit action
@sagzy sagzy requested a review from SimonBackx March 6, 2024 08:24
@sagzy sagzy force-pushed the fix/backend-validation-free-tier-in-posts-tiers branch from 78b032c to 40c30e7 Compare March 6, 2024 10:38
Copy link
Contributor

@SimonBackx SimonBackx left a comment

Choose a reason for hiding this comment

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

I think we also need a non-bulk E2E test that tries to edit a post with a free tier and check if it isn't saved (because here was the main issue).

We should make sure we don't require changes in the API. Users should still be able to set the tiers of a post by only specifying the id's.

Apart from that we need to consider to also add the fix to the output serializer so we don't return the free tier for posts that already have the free tier linked (alternative would be a migration, but that is a lot heavier).

@sagzy sagzy force-pushed the fix/backend-validation-free-tier-in-posts-tiers branch 2 times, most recently from 1eac712 to b32c870 Compare March 6, 2024 12:36
@sagzy sagzy requested a review from SimonBackx March 6, 2024 13:22
.matchBodySnapshot({
pages: [Object.assign({}, matchPageShallowIncludes, {
published_at: null,
tiers: [{id: paidTier.id, ...tierSnapshot}]
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be

Suggested change
tiers: [{id: paidTier.id, ...tierSnapshot}]
tiers: [{id: paidTier.id}]

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is to avoid timestamps issues with the updated_at fields are so on

@sagzy sagzy merged commit 00cff0a into main Mar 6, 2024
20 checks passed
@sagzy sagzy deleted the fix/backend-validation-free-tier-in-posts-tiers branch March 6, 2024 20:30
sagzy added a commit that referenced this pull request Mar 6, 2024
refs INC-36
fixes #19796

- The tiers-only paywall was incorrectly rendering "Free". Example:
"This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all
paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be
showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers,
before updating a Post or a Page. The fix includes bulk updates from the
list of Posts and Pages (right-click on a Post/Page > Change Access).
allouis added a commit that referenced this pull request Mar 8, 2024
* upstream/main: (32 commits)
  Update dependency i18next to v23.10.1
  Fixed udpated banner z-index (#19822)
  Update dependency jose to v4.15.5
  Update dependency express to v4.18.3
  v5.80.1
  Fixed tiers paywall selecting all paid tiers (#19817)
  🐛 Fixed free tier showing in the tiers-only paywall in posts (#19807)
  Fixed tiers paywall selecting all paid tiers (#19817)
  🐛 Fixed free tier showing in the tiers-only paywall in posts (#19807)
  Fix a French translation error in portal.json (#19803)
  Updated test to check for Unsplash button in Admin (#19814)
  Fixed button spacing in Portal unsubscribe popup footer (#19815)
  Update dependency terser to v5.29.1
  Released Portal v2.37.5 (#19812)
  Update dependency terser to v5.29.0
  🎨 Improved lazy-loading of comments data (#19809)
  Fixed various Unsplash design bugs (#19806)
  🎨 Improved lazy-loading of comments data (#19809)
  🐛 Fixed unexpected conversion of single-quoted attributes in HTML cards (#19727)
  Fixed various Unsplash design bugs (#19806)
  ...
aileen pushed a commit to aileen/Ghost that referenced this pull request Mar 12, 2024
…t#19807)

refs INC-36
fixes TryGhost#19796

- The tiers-only paywall was incorrectly rendering "Free". Example:
"This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all
paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be
showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers,
before updating a Post or a Page. The fix includes bulk updates from the
list of Posts and Pages (right-click on a Post/Page > Change Access).
aileen pushed a commit to aileen/Ghost that referenced this pull request Mar 12, 2024
…t#19807)

refs INC-36
fixes TryGhost#19796

- The tiers-only paywall was incorrectly rendering "Free". Example:
"This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all
paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be
showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers,
before updating a Post or a Page. The fix includes bulk updates from the
list of Posts and Pages (right-click on a Post/Page > Change Access).
aileen pushed a commit to aileen/Ghost that referenced this pull request Mar 12, 2024
…t#19807)

refs INC-36
fixes TryGhost#19796

- The tiers-only paywall was incorrectly rendering "Free". Example:
"This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all
paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be
showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers,
before updating a Post or a Page. The fix includes bulk updates from the
list of Posts and Pages (right-click on a Post/Page > Change Access).
aileen pushed a commit to aileen/Ghost that referenced this pull request Mar 12, 2024
…t#19807)

refs INC-36
fixes TryGhost#19796

- The tiers-only paywall was incorrectly rendering "Free". Example:
"This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all
paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be
showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers,
before updating a Post or a Page. The fix includes bulk updates from the
list of Posts and Pages (right-click on a Post/Page > Change Access).
aileen pushed a commit to aileen/Ghost that referenced this pull request Mar 12, 2024
…t#19807)

refs INC-36
fixes TryGhost#19796

- The tiers-only paywall was incorrectly rendering "Free". Example:
"This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all
paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be
showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers,
before updating a Post or a Page. The fix includes bulk updates from the
list of Posts and Pages (right-click on a Post/Page > Change Access).
aileen pushed a commit to aileen/Ghost that referenced this pull request Mar 13, 2024
…t#19807)

refs INC-36
fixes TryGhost#19796

- The tiers-only paywall was incorrectly rendering "Free". Example:
"This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all
paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be
showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers,
before updating a Post or a Page. The fix includes bulk updates from the
list of Posts and Pages (right-click on a Post/Page > Change Access).
aileen pushed a commit to aileen/Ghost that referenced this pull request Mar 13, 2024
…t#19807)

refs INC-36
fixes TryGhost#19796

- The tiers-only paywall was incorrectly rendering "Free". Example:
"This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all
paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be
showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers,
before updating a Post or a Page. The fix includes bulk updates from the
list of Posts and Pages (right-click on a Post/Page > Change Access).
aileen pushed a commit to aileen/Ghost that referenced this pull request Mar 13, 2024
…t#19807)

refs INC-36
fixes TryGhost#19796

- The tiers-only paywall was incorrectly rendering "Free". Example:
"This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all
paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be
showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers,
before updating a Post or a Page. The fix includes bulk updates from the
list of Posts and Pages (right-click on a Post/Page > Change Access).
aileen pushed a commit to aileen/Ghost that referenced this pull request Mar 13, 2024
…t#19807)

refs INC-36
fixes TryGhost#19796

- The tiers-only paywall was incorrectly rendering "Free". Example:
"This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all
paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be
showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers,
before updating a Post or a Page. The fix includes bulk updates from the
list of Posts and Pages (right-click on a Post/Page > Change Access).
aileen pushed a commit to aileen/Ghost that referenced this pull request Mar 13, 2024
…t#19807)

refs INC-36
fixes TryGhost#19796

- The tiers-only paywall was incorrectly rendering "Free". Example:
"This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all
paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be
showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers,
before updating a Post or a Page. The fix includes bulk updates from the
list of Posts and Pages (right-click on a Post/Page > Change Access).
royalfig pushed a commit that referenced this pull request Mar 25, 2024
refs INC-36
fixes #19796

- The tiers-only paywall was incorrectly rendering "Free". Example:
"This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all
paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be
showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers,
before updating a Post or a Page. The fix includes bulk updates from the
list of Posts and Pages (right-click on a Post/Page > Change Access).
royalfig pushed a commit that referenced this pull request Mar 25, 2024
refs INC-36
fixes #19796

- The tiers-only paywall was incorrectly rendering "Free". Example:
"This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all
paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be
showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers,
before updating a Post or a Page. The fix includes bulk updates from the
list of Posts and Pages (right-click on a Post/Page > Change Access).
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.

{{tiers}} helper has regression in 5.80 - "free" tier shown in list.
2 participants