-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add comments expire date #32863
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
Add comments expire date #32863
Conversation
02c2aa0 to
509ab48
Compare
|
Tested with our instance: SELECT COUNT(*) FROM oc_comments;
+----------+
| COUNT(*) |
+----------+
| 1059368 |
+----------+
ALTER TABLE `oc_comments` ADD `expire_date` DATETIME NULL AFTER `reactions`;
Query OK, 0 rows affected (0.028 sec)
Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE `oc_comments` ADD INDEX `expire_date` (`expire_date`);
Query OK, 0 rows affected (2.084 sec)
Records: 0 Duplicates: 0 Warnings: 0So sounds good. |
|
Now, can I squash the commits? |
Sounds good to me |
|
you need to run |
81ccb9f to
71b1fbb
Compare
nextcloud/spreed#7327 Signed-off-by: Vitor Mattos <[email protected]>
71b1fbb to
c59b0c2
Compare
|
Autoload updated with new migration file and commits squashed. |
blizzz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI is unhappy
expire_date is also not exposed in DAV API, making it inconsistent with the other features. Cf. apps/dav/lib/Comments/CommentNode.php
tests/lib/Comments/ManagerTest.php
Outdated
| ); | ||
|
|
||
| // just to make sure they are really set, with correct actor data | ||
| $comment = $manager->get(strval($ids[1])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| $comment = $manager->get(strval($ids[1])); | |
| $comment = $manager->get((string)$ids[1]); |
micro optimization :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I tested the two ways and don't identify the difference. Can you explain the optimization in this case?
https://gist.github.com/vitormattos/e242d41f92dc1ae4548c7311644fb287
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS: I only followed the pattern to get string value used in other methods of this test class, but normally I prefer to use (string) only because I think is most common to found in texts.
Only by curiosity I did this:
git grep strval|wc -l
32
git grep "(string)"|wc -l
481
Maybe, I think is good to change the 32 places of strval in server repository to (string)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did other test to check the opcode in site 3v4l.org using the follow code:
echo (string) 1;
echo strval(1);
echo (string) 1;...and the opcode is the same:
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
3 0 E > CAST 6 ~0 1
1 ECHO ~0
4 2 CAST 6 ~1 1
3 ECHO ~1
5 4 CAST 6 ~2 1
5 ECHO ~2
6 6 > RETURN 1
I duplicated the first row to check if the return is from strval or is the return of script, the return is from script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, it was intval vs int-casting. Never mind then!
Neither is the optional |
Does not mean it is not worth to add it there as well. The reference id has of course less meaning for file comments. The expiry date would be more relevant, but on the other hand the web ui does not offer this option either. Thus, I also agree it is okay to leave it out, nevertheless worth to point out that this is done deliberately. P.S.: i.e. my rejection is about the failing tests. |
Signed-off-by: Vitor Mattos <[email protected]>
``` git grep strval|wc -l 32 git grep "(string)"|wc -l 481 ``` Signed-off-by: Vitor Mattos <[email protected]>
|
Missing a version bump |
Related: nextcloud/spreed#7327