Skip to content

🧾Add share metadata#8069

Open
AndyScherzinger wants to merge 3 commits into
mainfrom
feat/noid/share-metadata
Open

🧾Add share metadata#8069
AndyScherzinger wants to merge 3 commits into
mainfrom
feat/noid/share-metadata

Conversation

@AndyScherzinger

@AndyScherzinger AndyScherzinger commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary

While starting to work on #8052 (nowhere near completion..) to implement the sdhare review capability I realized that the share date always matched 1970 and digging and asking @grnd-alt it turned out deck shares have no creation and no last-edit date, like for example files/folder or tables shares. Yet for a share review app, that also stores a "review date" such timestamps are important to show a changed share for a re-review in case it changed. Hence creation and edit dates a crucial.

TODO

  • get CI to turn green 💚

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Documentation (manuals or wiki) has been updated or is not required

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@AndyScherzinger AndyScherzinger force-pushed the feat/noid/share-metadata branch 8 times, most recently from af1f803 to 7e3e603 Compare June 19, 2026 19:31
@AndyScherzinger AndyScherzinger marked this pull request as ready for review June 19, 2026 19:46
@nextcloud nextcloud deleted a comment from github-actions Bot Jun 19, 2026
@nextcloud nextcloud deleted a comment from github-actions Bot Jun 19, 2026
@nextcloud nextcloud deleted a comment from github-actions Bot Jun 19, 2026
@nextcloud nextcloud deleted a comment from github-actions Bot Jun 19, 2026
@nextcloud nextcloud deleted a comment from github-actions Bot Jun 19, 2026
Comment thread lib/Migration/AclTimestampBackfill.php Outdated
$now = time();
$groups = [];
foreach ($rows as $row) {
$timestamp = ((int)$row['board_last_modified'] > 0) ? (int)$row['board_last_modified'] : $now;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

idk if we should really backfill that way, does the app you're doing all that for not have an option to have an unknown value?
The values we're writing in here 99% of the time are not the real created/last_modified of the acl, so an unknown value would be better imo, or at least just the "now" value so it is clear that the value was written when the update was done.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We can use any we would want, the share review app would else have to assume one and either that is a fully hard-coded and fixed date, no matter the share, or needs to be computed each time the shares are loaded for review. So to me, compute-once made the most sense and going with a creation/modification date of the board itself seemed most feasible. However we could also go for $now if you think that would be better. But in any care I suggest to pre-compute and migrate to a date and not have a fallback logic because we lacked dates in the past.

WDYT @grnd-alt @blizzz ? "No date" feels wrong to me, but that might be me, than we can also just leave it at 0 and take that as "unknown".

Both has its advantages, one is unknown: cause it hasn't been tracked but mid-term I find this confusing to users when there are shares with known and unknown dates.

Both works for me. I can find a way to explain the unknown in the review app of course.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My general preference is having a one time (migration) operation over some extra business logic code that then has to be kept maintained over a long time/forever. So this would be in favor of the update step.

I guess this could run long, so there should be some progress output to avoid wild cancellation by the admin.

Having a "now" date in there seems odd in itself though and might lead to wrong assumptions. This is the more critical question imo: what does it tell users and can it be misleading? Alternative coulde setting to 01-01-1970 and still handling as "unknown", but this brings the extra treatment again.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll then go for 0 as in 01-01-1970. Currently not shown in the deck UI anyways and the share review app can than have some handling for the magic number 👍

…s to deck_board_acl

Adds two integer columns (default 0) to track when a share was created
and last modified. A value of 0 is a magic sentinel meaning "unknown"
and covers all pre-existing shares.

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Records created_at on share insertion and updates last_modified_at on
every subsequent modification. The created_at value is preserved across
updates. Existing shares retain the 0 sentinel (unknown).

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger AndyScherzinger force-pushed the feat/noid/share-metadata branch from 7e3e603 to 4f1a9d7 Compare June 24, 2026 18:44
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.

3 participants