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

[bug] Dont reset downloadcounter when editting files #4033

Open
davehakkens opened this issue Dec 9, 2024 · 6 comments
Open

[bug] Dont reset downloadcounter when editting files #4033

davehakkens opened this issue Dec 9, 2024 · 6 comments
Assignees

Comments

@davehakkens
Copy link
Contributor

Describe the bug
People can attached files and urls to download. But when people edit them the counter resets to 0.
The count needs to continue

image This component is useds in how-to, questions, research module

To Reproduce
Steps to reproduce the behaviour:

  1. Go to how-to's
  2. Create new how-to
  3. Attach a files
  4. Download
  5. Re upload file
  6. See counter reset
  7. Download again

Expected behaviour
Dont reset the counter when re-uploading files or changing urls

@ebradbury
Copy link

I'd like to work on this bug. I think it's a quick fix in research.store Can someone tell me which tests I should run or create to cover this? Thanks

@benfurber
Copy link
Member

Awesome, thanks @ebradbury for taking this one!

I think an e2e spec for this would be good. You'll need a command similar to cy.setSettingImage() which you can see setup on packages/cypress/src/support/commandUi.ts.

The spec to extend is [Research]/[Create research article]/[By Authenticated] on packages/cypress/src/integration/research/write.spec.ts. I'd suggest at the end of that test to; add a file, log the user out (newCollaborator), sign-up a new user, download, (ideally the counter updates to one), logout, log newCollaborator back in, change file, check that the counter is long.

Make sense?

@ebradbury
Copy link

@benfurber I think so... let me see what I can come up with.

@ebradbury
Copy link

ebradbury commented Dec 13, 2024

@benfurber Is there any reason why we can't do the test with one user (newCollaborator)? They can upload the file, download the file (to increment the download counter), replace the file and check the download counter length. I'm not sure that signing up a new user is required but let me know what you think!

@benfurber
Copy link
Member

...You're almost certainly right @ebradbury! We use to have heavier store caching which would be weird at times. Much better now though.

@benfurber
Copy link
Member

Hey @ebradbury, how are you getting on?

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

No branches or pull requests

3 participants