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

fix: truncate screenshot filenames using byteLength #8175

Merged
merged 5 commits into from Aug 10, 2020
Merged

Conversation

flotwig
Copy link
Contributor

@flotwig flotwig commented Aug 4, 2020

User facing changelog

  • Fixed an issue where screenshots could fail because of names that were too long for the filesystem to accept.

Additional details

  • now using bytes instead of characters to resize the string
  • if an ENAMETOOLONG error is encountered, the string will be further downsized, down to a minimum of 64 bytes after which the error will still be thrown, like described in Truncate file names for screenshots #2635 (comment)

How has the user experience changed?

PR Tasks

  • Have tests been added/updated?
  • Has the original issue been tagged with a release in ZenHub?
  • [na] Has a PR for user-facing changes been opened in cypress-documentation?
  • [na] Have API changes been updated in the type definitions?
  • [na] Have new configuration options been added to the cypress.schema.json?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Aug 4, 2020

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Aug 4, 2020



Test summary

7931 0 130 2


Run details

Project cypress
Status Passed
Commit dc57c16
Started Aug 10, 2020 4:16 PM
Ended Aug 10, 2020 4:22 PM
Duration 06:33 💡
OS Linux Debian - 10.1
Browser Multiple

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

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

@flotwig I think that we could probably sprinkle in some DEBUG logs into the new logic, so that we can debug in the future about how the truncation is occurring in case some other issue crops up.

Otherwise it looks fine.

packages/server/lib/screenshots.js Outdated Show resolved Hide resolved
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
@flotwig flotwig merged commit 1241922 into develop Aug 10, 2020
@flotwig flotwig deleted the issue-2403 branch January 24, 2022 18:15
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.

Screenshot file name too long warning when Bytes exceeded
2 participants