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

feat(files): update mtime on attributes tampering #602

Merged
merged 1 commit into from Apr 11, 2023
Merged

Conversation

skjnldsv
Copy link
Contributor

@skjnldsv skjnldsv commented Mar 17, 2023

When we change an attribute or rename/move a file, the mtime should be edited automatically

  • get mtime
  • get crtime
  • proxy attributes
  • testing

@skjnldsv skjnldsv added the enhancement New feature or request label Mar 17, 2023
@skjnldsv skjnldsv self-assigned this Mar 17, 2023
@skjnldsv skjnldsv force-pushed the fix/mtime-files branch 4 times, most recently from 8b1ce0e to 4f27fcb Compare March 17, 2023 17:08
@skjnldsv skjnldsv requested a review from susnux March 17, 2023 17:11
@skjnldsv skjnldsv requested review from artonge and Pytal April 7, 2023 06:23
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
@codecov
Copy link

codecov bot commented Apr 7, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (da0db10) 100.00% compared to head (fffd8d8) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #602   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines          216       224    +8     
  Branches        62        62           
=========================================
+ Hits           216       224    +8     
Impacted Files Coverage Δ
lib/files/node.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

lib/files/node.ts Show resolved Hide resolved
lib/files/node.ts Show resolved Hide resolved
file.attributes.test = true

// Check that mtime has been updated
expect(file.mtime?.getDate()).toBe(new Date().getDate())
Copy link
Contributor

Choose a reason for hiding this comment

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

this test will fail occasionally if the previous statement runs a microsecond earlier than the next invocation of new Date

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No because I'm comparing the date, so it would have to be exactly 1ms before midnight 😁

@skjnldsv skjnldsv merged commit 28dbb82 into master Apr 11, 2023
17 checks passed
@delete-merged-branch delete-merged-branch bot deleted the fix/mtime-files branch April 11, 2023 07:00
@skjnldsv skjnldsv mentioned this pull request Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants