| #
8788dbbd |
| 06-May-2026 |
splitbrain <86426+splitbrain@users.noreply.github.com> |
Rector and PHPCS fixes
|
| #
01e8d739 |
| 25-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
refactor(changelog): persist external-edit detection on first read
This addresses the flaky test that makes tests randomly fail (mostly on windows runners).
The flake in common_saveWikiText_test::t
refactor(changelog): persist external-edit detection on first read
This addresses the flaky test that makes tests randomly fail (mostly on windows runners).
The flake in common_saveWikiText_test::test_savesequence5 came from this line in ChangeLog::getCurrentRevisionInfo():
'date' => max($lastRev + 1, time() - 1)
The synthesized "external delete" entry was kept in memory only and only persisted later, when saveWikiText next called detectExternalEdit. That meant the formula was evaluated twice on different ChangeLog instances — once during the test's inspection, and again during the following saveWikiText — and the two evaluations could pick different seconds depending on how long the surrounding I/O took. The test cached the first result in $expectExternal and asserted it against the on-disk entry written during the second call. On the slower Windows runner the second call sometimes crossed a second boundary, producing the off-by-one date mismatch.
The questions I had was, why are we persisting external file deletions (or edits) only when a page is saved when we are obviously already detecting it earlier during the changelog read already?
Instead of recording the external delete at the time a new page is written, it makes sense to record it as soon as we detect it (when the changelog is requested by a user or a bot). This will make the recoded timestamp closer to the actual deletion.
This patch refactors the changelog accordingly, but still tries to be minimal invasive (I think the changelog handling would need much more refactoring, but that's beyond the scope of this change).
To enable proper locking (when logging an external edit and copying the attic file), locking had to be moved to the Changelog class, duplicating some code of io_saveFile.
PageFile::detectExternalEdit() and the deprecated procedural wrapper detectExternalEdit() in inc/common.php are removed. A codesearch.dokuwiki.org check confirmed no plugin calls the method directly; the only external caller of the procedural function is the farmsync plugin, which needs a parallel update.
show more ...
|
| #
d41f5a8f |
| 07-Mar-2026 |
Andreas Gohr <andi@splitbrain.org> |
fix destructuring false returns from changelog functions
The changelog functions can return false when lines are unparsable or don't exist. The result can no longer be destructured then in newer PHP
fix destructuring false returns from changelog functions
The changelog functions can return false when lines are unparsable or don't exist. The result can no longer be destructured then in newer PHP versions. This adds the necessary checks.
It should also handle corrupt lines within a changelog better.
show more ...
|
| #
4d95c168 |
| 24-Sep-2023 |
Gerrit Uitslag <klapinklapin@gmail.com> |
code style
|
| #
85160059 |
| 24-Sep-2023 |
Gerrit Uitslag <klapinklapin@gmail.com> |
little refactoring
|
| #
a835c93a |
| 24-Sep-2023 |
Gerrit Uitslag <klapinklapin@gmail.com> |
Let ChangeLog set the mode(media/page) for a revision log entry
|
| #
0f8604a9 |
| 02-Sep-2023 |
Andreas Gohr <andi@splitbrain.org> |
don't strict compare
I'm not 100% sure but revs might be strings sometimes, so better not chage current behavior
|
| #
90fb952c |
| 31-Aug-2023 |
Andreas Gohr <andi@splitbrain.org> |
code style: operator spacing
|
| #
7d34963b |
| 31-Aug-2023 |
Andreas Gohr <andi@splitbrain.org> |
coding style: control flow line breaks
|
| #
177d6836 |
| 31-Aug-2023 |
Andreas Gohr <andi@splitbrain.org> |
coding style: control flow whitespaces
|
| #
83bec475 |
| 31-Aug-2023 |
Andreas Gohr <andi@splitbrain.org> |
fix abstract declaration of ChangeLog::getFilename()
|
| #
6e695190 |
| 29-Aug-2023 |
Andreas Gohr <andi@splitbrain.org> |
fix sizehandling in Changelog
Seems rector was too aggressive here in removing a variable.
|
| #
0603e565 |
| 29-Aug-2023 |
Andreas Gohr <andi@splitbrain.org> |
Apply rector fixes to inc/ChangeLog
|
| #
aec2ae89 |
| 24-Jun-2022 |
Andreas Gohr <andi@splitbrain.org> |
Merge pull request #3607 from ssahara/revdiff2
add mechanism to track current revision, and other code improvements
|
| #
10f359ad |
| 28-Apr-2022 |
Andreas Gohr <andi@splitbrain.org> |
Replace direct calls to strftime with dformat calls
This is in preparation for fixing #3573
|
| #
eeda7ada |
| 23-Jan-2022 |
Gerrit Uitslag <klapinklapin@gmail.com> |
some spelling
|
| #
a19054e9 |
| 23-Jan-2022 |
Satoshi Sahara <sahara.satoshi@gmail.com> |
fix typo
|
| #
312e7095 |
| 23-Jan-2022 |
Satoshi Sahara <sahara.satoshi@gmail.com> |
add mechanism to track external current revision
|
| #
86216bf0 |
| 06-Jan-2022 |
Gerrit Uitslag <klapinklapin@gmail.com> |
Move caching current revision info to getRevisionInfo()
needed to ensure initiation of the class is not using files from disk. Because getCurrentRevisionInfo needs getRevisionInfo() as well, looping
Move caching current revision info to getRevisionInfo()
needed to ensure initiation of the class is not using files from disk. Because getCurrentRevisionInfo needs getRevisionInfo() as well, looping needs to be prevented
show more ...
|
| #
54d95e36 |
| 06-Jan-2022 |
Gerrit Uitslag <klapinklapin@gmail.com> |
revInfo was already retrieved
|
| #
0b5bb6b4 |
| 06-Jan-2022 |
Gerrit Uitslag <klapinklapin@gmail.com> |
at this point it is already checked that $fileRev exists
|
| #
79a2d784 |
| 05-Jan-2022 |
Gerrit Uitslag <klapinklapin@gmail.com> |
import classes, replace dbglog, simplify, remove unused statements, and other warnings from IntelliJ
update phpdocs, rename dokuwiki/Ui/Draft to PageDraft
|
| #
66f4cdd4 |
| 24-Nov-2021 |
Satoshi Sahara <sahara.satoshi@gmail.com> |
set current revision date 1sec before now for external deletion
in preparation for possible new page save
|
| #
05282e9f |
| 13-Nov-2021 |
Satoshi Sahara <sahara.satoshi@gmail.com> |
use time() for revision date of externally deleted page
also, code doc updates
|
| #
d154755d |
| 13-Nov-2021 |
Satoshi Sahara <sahara.satoshi@gmail.com> |
rename saveRevisionInfo to cacheRevisionInfo
|