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

Problems with page refresh on a new collection page #2450

Open
MisRob opened this issue Oct 15, 2020 · 5 comments
Open

Problems with page refresh on a new collection page #2450

MisRob opened this issue Oct 15, 2020 · 5 comments
Assignees
Labels

Comments

@MisRob
Copy link
Member

MisRob commented Oct 15, 2020

Summary

When I reload a new collection page then:

1. In Chrome, I can see "Page not found" but there is an error in a console:

Uncaught (in promise) TypeError: Cannot read property 'toString' of undefined

Selection_003

2. In Firefox, I can't see "Page not found":

Firefox behavior is problematic on different pages in this regard - see #2389.

Selection_002


A general solution might be needed - see @jonboiser's comment.

Category

BUG

Usage Details

  • Browser: Firefox, Chrome (different problems)

How to reproduce

  1. Go to /channels
  2. Navigate to "Collections" tab
  3. Click "NEW COLLECTION" button
  4. Reload the page

Real-life consequences

Confusion

@MisRob MisRob added bug frontend P2 - normal Priority: Nice to have labels Oct 15, 2020
@MisRob MisRob added this to the Vue Refactor milestone Oct 15, 2020
@jonboiser
Copy link
Contributor

A general solution might be needed - see @jonboiser's comment.

My suggestion was basically to not generate a UUID for a new Channel or Collection just for opening this modal. Is there a reason why we generate these IDs in advance? Or is it okay to not generate (or generate, but not put it in the URL right away) these IDs?

@MisRob
Copy link
Member Author

MisRob commented Dec 21, 2020

My suggestion was basically to not generate a UUID for a new Channel or Collection just for opening this modal

This makes sense to me.

Is there a reason why we generate these IDs in advance? Or is it okay to not generate (or generate, but not put it in the URL right away) these IDs?

Sounds good to me. As long as we don't save the new, empty, object I can imagine using /new in URL. I assume that it's okay not to save an empty object and that ID might be generated later, when there are some data. Though I am not familiar with decisions around the current behavior and assume that it has something to do with creating new objects in IndexedDB so it would be better to check with @rtibbles in more detail.

@rtibbles
Copy link
Member

rtibbles commented Jan 4, 2021

The current behaviour of generating the UUID and using that in the URL was implemented prior to the deferred saving of new channels, so no problem in changing that. It will be easiest to still let the UUID be generated, but just use the /new in the URL as you suggest, this should not cause any issues.

@rtibbles rtibbles removed this from the Vue Refactor milestone Jan 19, 2021
@jonboiser jonboiser self-assigned this Feb 15, 2021
@jonboiser
Copy link
Contributor

jonboiser commented Feb 16, 2021

In Chrome, the problem seems to be that when you refresh at a URL like
http://localhost:8080/en/channels/#/collections/8ee60d42abbd4a6a870733764ebf0d57

Which is a new, but unsaved collection, then you get an ill-formed msg object in handleFetchMessages

image

This results in two invalid calls:

/api/collections/api/channel
/api/channeluser?channel=collections

both returning a 404 => Error page, since it's treating the route component /collections as a channel ID.

However, if you refresh the link on a valid collection ID, you get the right msg and no problems.

I think if this behavior was fixed, it would resolve the original issue. But it also needs to be fixed just to implement a simplified client-side route like /collections/new.

@shruti862
Copy link
Contributor

@bjester , I would like to work on this issue also; please assign me this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants