Uh oh!
There was an error while loading. Please reload this page.
Fix comments (and systemtags) when involving users with numerical ids - #8355
Conversation
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
| foreach ($users as $user => $path) { | ||
| $activity->setAffectedUser($user); | ||
| // numerical user ids end up as integers from array keys, but string |
There was a problem hiding this comment.
that also means leading zeros will be a problem?
There was a problem hiding this comment.
keys with leading zeros are handled as strings, provided that they are passed as strings. #consistencyftw
nickvergessen
commented
Feb 14, 2018
Activity is fixed with that since ~1 year: https://github.com/nextcloud/activity/pull/102/files |
Codecov Report
@@ Coverage Diff @@## master #8355 +/- ##
============================================
+ Coverage 51.69% 51.82% +0.13% - Complexity 25390 25392 +2
============================================
Files 1599 1600 +1 Lines 95099 95195 +96 Branches 1376 1376 ============================================
+ Hits 49157 49339 +182 + Misses 45942 45856 -86
|
blizzz
commented
Feb 14, 2018
@nickvergessen not completely, |
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
blizzz
commented
Feb 15, 2018
Activity and a fix for spreed go into respective repos. Failing test unrelated. |
blizzz
commented
Feb 23, 2018
may i ask for a new round of reviews? |
test creating comments with numeric user ids Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de> fix creating comments when file is accessible to users with numeric ids Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de> tests for systemtags related to numeric user ids Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de> fix systemtags event with numeric user ids Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
test creating comments with numeric user ids Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de> fix creating comments when file is accessible to users with numeric ids Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de> tests for systemtags related to numeric user ids Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de> fix systemtags event with numeric user ids Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
similar cases to resolve in
Activity → FileHooks→ own repoand needs backporting.
Casting uids to strings everywhere is fragile, but that's how PHP deals with array keys. Relaxing setAffectedUser to accept ints would work, but is ugly. To accept IUser would be better, but would break compat.
cc @nickvergessen