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

Setting or changing a products perma-link causes hard refresh #2246

Closed
spencern opened this issue May 11, 2017 · 6 comments

Comments

5 participants
@spencern
Copy link
Member

commented May 11, 2017

Expected behavior

When I publish a product, I'd expect the app to do so without refreshing

Actual Behavior

http://g.recordit.co/DwTDf6K2O9.gif
When updating a product's permalink (even for the first time), the app refreshes upon publish.

Steps to Reproduce the Behavior

  1. Clone development
  2. Login as admin
  3. Create a new product.
  4. Set variant label to something
  5. Click the edit button next to the social icons
  6. Open the product settings accordion
  7. Set the product title (and the perma-link will be set as well)
  8. Hit publish
  9. Observe hard refresh.

Versions

Node: 7.8.0
NPM: 4.5.0
Meteor Node: 4.8.2
Meteor NPM: 4.5.0
Reaction CLI: 0.8.1
Reaction: 1.1.1
Reaction branch: development
Docker: 17.03.1-ce
@michael-alade

This comment has been minimized.

Copy link
Contributor

commented Jun 2, 2017

A PR has been opened for this issue, but removing the hard reload seems to affect the product grid after I've clicked on the brand name to return to the product grid. I came up with a solution but it needs to be reviewed and accepted by the core team members. I would be posting a detailed description of the two possible solutions for the issue.

@zenweasel

This comment has been minimized.

Copy link
Member

commented Jun 5, 2017

@michael-alade What's the status on this?

@michael-alade

This comment has been minimized.

Copy link
Contributor

commented Jun 5, 2017

@zenweasel I joined the daily sit-down to convince the team about using the .direct method when updating a product after clicking publish. But I was told to check out subscription manager to try and reset the subscription cache as that might be the cause of the revisions not showing on the product grid.

@zenweasel

This comment has been minimized.

Copy link
Member

commented Jun 8, 2017

As we had discussed, please make notes on this ticket regarding your progress and where we are leaving this.

@michael-alade

This comment has been minimized.

Copy link
Contributor

commented Jun 8, 2017

Having tried to use the Route.go for redirect the seller to the new product permalink after publishing the product, I still got another issue with the product not being found. Also, for the product grid, I tried using subscription manager but it seems to be the wrong approach. We think this is caused by the Revisions collection being updated when publishing the product.

@zenweasel zenweasel reopened this Jun 8, 2017

@aaronjudd

This comment has been minimized.

Copy link
Contributor

commented Jun 20, 2017

@michael-alade is this resolved? --> not just the reason your approach doesn't work.. but somebody still needs to resolve... .

@spencern spencern added this to the Bugfix Sprint 1 milestone Feb 9, 2018

@prinzdezibel prinzdezibel self-assigned this Feb 13, 2018

prinzdezibel added a commit that referenced this issue Feb 14, 2018

Fix: Setting or changing a products perma-link causes hard refresh
Closes issue #2246

Changes:
- Don't trigger route change from callback value of meteor call
`revisions/publish`, because
   -> it's changing server state. It's not possible to rely on the
   publications already being synced to the client side when the
   method returns. This led to race conditions when trying to change the
   route client side, therefore it was done the hard way by setting
   window.location.href

   Tried to observe permalink changes client side, but that was
   unreliable as well, because tracker runs may re-instantiate observed
   cursors at any time.

   -> it's not reactive (other connected clients won't get the route
   change), when the permalink has changed

   INSTEAD we observe changes to handles server side and let the client
   know it has changed through a new property `changedHandleWas`, which
   will be published like any other property (but doesnt' get
   persisted to db)

- ProductDetailContainer needs to subscribe to `Products`, as it is
dependent on ReactionProduct.setProduct, which itself is dependent on
`Products`.

- don't use window.location.href for route changes any more. Router.go
is used instead

@spencern spencern removed this from the Bugfix Sprint 1 milestone Feb 20, 2018

@prinzdezibel prinzdezibel added blocked and removed blocked labels Feb 27, 2018

@spencern spencern referenced this issue Mar 8, 2018

Merged

Release 1.9.0 #3941

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.