Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Update LastLoginTimestamp when importing for a new user #236

Merged
merged 2 commits into from
Jul 26, 2023
Merged

Conversation

phil-davis
Copy link
Contributor

@phil-davis phil-davis commented Jul 24, 2023

Description

Set the LastLoginTimestamp when a user is created for an import.
That prevents later code from executing "first time login" actions for the user when they next log in.
The importer already does the needed stuff to set up the user's file system etc. We don't want later code to do "bonus" stuff, like copying in the skeleton.

A test scenario has been added to cover importing when a skeleton dir is defined on the system. While doing that, I also improved the test code - it was not actually deleting imported users at the end of the scenario, and the simpleExport/userfoo fixture was missing a shares.jsonl file, which was causing the import to report a problem (but the files were being imported, so the existing tests were passing)

Related Issue

Fixes #234

How Has This Been Tested?

Manually rerun the sequence in the issue and observe that the skeleton files have not been accidentally added to the user's files.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

@dpapac dpapac left a comment

Choose a reason for hiding this comment

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

LGTM, if this is all it takes to prevent running actions, which usually only would be run on the first login -> ...should fix #234 👍🏼

Will leave the approval of the PR to jvillafanez

@sonarcloud
Copy link

sonarcloud bot commented Jul 25, 2023

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

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@jvillafanez jvillafanez left a comment

Choose a reason for hiding this comment

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

This should be documented somewhere.

@phil-davis
Copy link
Contributor Author

This should be documented somewhere.

See doc PR owncloud/docs-server#1052

@phil-davis phil-davis merged commit 0c67f71 into master Jul 26, 2023
1 check passed
@delete-merged-branch delete-merged-branch bot deleted the fix-234 branch July 26, 2023 08:31
@phil-davis
Copy link
Contributor Author

@jnweiger if you have a release branch in progress, then please cherry-pick (or however you want to do it) this into the release branch.

@jnweiger
Copy link
Contributor

Thanks @phil-davis - merged into release-0.3.0

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

Successfully merging this pull request may close these issues.

occ instance:import:user overwrites e.g. Photos with Skeleton files during import
4 participants