skip to next user on OutOfBoundsException#28805
Conversation
| $this->mapper->insert($a); | ||
| // clean the user's preferences | ||
| $this->cleanPreferences($uid); | ||
| } catch (\OutOfBoundsException $e) { |
There was a problem hiding this comment.
OutOfBounds is a bad naming choice if the exception is expected to be thrown when we can access to the property. I'd rather use a custom public exception here.
| ['app' => self::class] | ||
| ); | ||
| continue; | ||
| try { |
There was a problem hiding this comment.
maybe we could move this try / catch block to another function. This way we can avoid this nested try / catch, and also make this function more compact.
|
@butonic any update ? See comments above. Else would defer to "planned" for the next release. |
|
moving to "planned" as discussed with @butonic |
| $this->logger->logException($e, ['app' => self::class]); | ||
| } | ||
| // clean the user's preferences | ||
| $this->cleanPreferences($uid); |
|
@ownclouders rebase |
|
Hey! This pull request is being rebased automatically. Please DO NOT push while rebase is in progress or your changes would be lost! |
|
Automated rebase was successful! |
374a03d to
bc3cfbb
Compare
Codecov Report
@@ Coverage Diff @@
## master #28805 +/- ##
============================================
- Coverage 62.15% 62.15% -0.01%
- Complexity 17516 17517 +1
============================================
Files 1045 1045
Lines 57740 57742 +2
============================================
Hits 35890 35890
- Misses 21850 21852 +2
Continue to review full report at Codecov.
|
|
closing, as the current code already continues on all Exceptions. logging errors to the console tracked in #31310 |
|
|
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
on large ldap instances a missing uuid or username currently aborts the whole sync. This PR allows backends to indicate these problems and fail with an OutOfBoundsException. For now core will log the exception and continue with the next user.
In the future we should expose this to the cli.
together with owncloud/user_ldap#125 this skips problematic ldap users