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

Ensure the /user/files directory is always present in the FS #40091

Merged
merged 5 commits into from
Jun 21, 2022

Conversation

jvillafanez
Copy link
Member

Description

Ensure the user's folder always exists. In addition, update the login timestamp after the user is prepared to login, in particular, after the skeleton files have been copied.

Related Issue

https://github.com/owncloud/enterprise/issues/5187

Motivation and Context

There might be temporary errors preventing the user's folder from being created properly. If this happens, the admin would need to create the directory by himself. This PR ensure that the user's folder is eventually created, assuming it's a temporary error.

How Has This Been Tested?

Manually tested.

  1. Login with a user
  2. Remove the "/user/files" directory from the command line
  3. Login again with the same user

The "/user/files" directory is recreated.
Note that step 2 is mostly for testing. The real expectation is that something goes wrong during the log in in step 1 and the "/user/files" directory isn't created in the first place.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@update-docs
Copy link

update-docs bot commented May 20, 2022

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@owncloud owncloud deleted a comment from ownclouders May 20, 2022
@ownclouders
Copy link
Contributor

ownclouders commented May 20, 2022

💥 Acceptance tests pipeline apiFederationToShares1-git-mariadb10.2-php7.4 failed. The build has been cancelled.

https://drone.owncloud.com/owncloud/core/35841/111

@phil-davis
Copy link
Contributor

boom Acceptance tests pipeline apiFederationToShares2-git-mariadb10.2-php7.4 failed. The build has been cancelled.

https://drone.owncloud.com/owncloud/core/35802/114

Initialized empty Git repository in /drone/src/.git/

+ git fetch origin +refs/heads/master:
error: RPC failed; curl 56 OpenSSL SSL_read: Connection reset by peer, errno 104
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

https://www.githubstatus.com/incidents/gcqz5grcs4z6 - there was an incident with GitHub that says it was resolved 40 minutes ago. Maybe it is not really resolved. Someone should restart CI "in a while".

@jvillafanez jvillafanez force-pushed the firstLoginFixes branch 2 times, most recently from 1418c18 to 4e7c525 Compare May 24, 2022 15:09
@phil-davis
Copy link
Contributor

phil-davis commented May 24, 2022

https://drone.owncloud.com/owncloud/core/35842/21/8
PHP unit tests
There were 8 failures:

This is issue #40098 and will block any merging of core PRs. I really don't know how to fix it.

Edit: fixed in #40101

@mmattel
Copy link
Contributor

mmattel commented Jun 20, 2022

@jvillafanez you have status 3-to review, this will hang forever if there is no reviewer set...

@phil-davis
Copy link
Contributor

"This branch is 2 commits ahead, 92 commits behind master."

It will be good to rebase also.

Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

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

Changelog also needed

lib/private/User/User.php Show resolved Hide resolved
@jvillafanez
Copy link
Member Author

Rebased, phpdocs and changelog added. I've also added the optional parameter in the interface.

@jvillafanez
Copy link
Member Author

jvillafanez commented Jun 20, 2022

It might need some additional testing due to f711efa#diff-6d9986f514cef64fbfae8dffa32eb7a38d35c9eda651e4ddf4d6c7bc2b4af884R95-R97
The change should be backwards-compatible so it shouldn't break anything.

Change reverted. The public interface won't change, and the private implementation will use the additional parameter. We'll keep it as an internal change.

Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

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

LGTM

@sonarcloud
Copy link

sonarcloud bot commented Jun 20, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

87.5% 87.5% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@JammingBen JammingBen left a comment

Choose a reason for hiding this comment

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

Code LGTM 👍

@phil-davis phil-davis merged commit 11790c2 into master Jun 21, 2022
@delete-merged-branch delete-merged-branch bot deleted the firstLoginFixes branch June 21, 2022 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants