Skip to content

chore: bump dependencies#6825

Merged
vitormattos merged 11 commits into
mainfrom
chore/bump-dependencies
Feb 13, 2026
Merged

chore: bump dependencies#6825
vitormattos merged 11 commits into
mainfrom
chore/bump-dependencies

Conversation

@vitormattos
Copy link
Copy Markdown
Member

No description provided.

@vitormattos vitormattos added this to the Next Major (34) milestone Feb 11, 2026
@vitormattos vitormattos self-assigned this Feb 11, 2026
@github-project-automation github-project-automation Bot moved this to 0. Needs triage in Roadmap Feb 11, 2026
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos force-pushed the chore/bump-dependencies branch from 771462f to 9c92f23 Compare February 11, 2026 19:48
When a sign request UUID is provided via header but user is not authenticated,
the session ID should be based on the UUID to maintain consistency across
multiple HTTP requests. Previously, each request without authentication created
a new session ID, causing signature elements to be saved with one session ID
but retrieved with a different one, resulting in 'Element not found' errors.

- Extract session consistency logic to private method with proper docblock
- Store the sign request UUID in the session when provided
- Fixes test: CRUD of signature element to signer by email without account
- Resolves issues where GET requests without sign request UUID header
  could not find elements created in POST requests with the header

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…uests apps (mysql)

- Apps notifications, activity, and guests require composer install
- Without installing dependencies, app:enable fails with autoload errors
- Use composer --working-dir instead of cd for cleaner shell commands
- Resolves 'Failed opening required vendor/autoload.php' error in behat tests

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…uests apps (pgsql)

- Apps notifications, activity, and guests require composer install
- Without installing dependencies, app:enable fails with autoload errors
- Use composer --working-dir instead of cd for cleaner shell commands
- Resolves 'Failed opening required vendor/autoload.php' error in behat tests

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…uests apps (sqlite)

- Apps notifications, activity, and guests require composer install
- Without installing dependencies, app:enable fails with autoload errors
- Use composer --working-dir instead of cd for cleaner shell commands
- Resolves 'Failed opening required vendor/autoload.php' error in behat tests

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…uests apps (mariadb)

- Apps notifications, activity, and guests require composer install
- Without installing dependencies, app:enable fails with autoload errors
- Use composer --working-dir instead of cd for cleaner shell commands
- Resolves 'Failed opening required vendor/autoload.php' error in behat tests

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Uses vi.hoisted() to ensure mocks are properly initialized before module
imports, preventing null reference errors in CI environment. This pattern
guarantees mock setup happens in the correct phase of Vitest execution.

Changes:
- Wrap all mock functions and capturedActionRef in vi.hoisted()
- Update all mock references to use mocks.* pattern
- Remove duplicate 'let action' declaration outside describe block
- Ensures action capture happens before first test runs

Fixes GitHub Actions test failures on CI (works locally without this fix
due to different module loading timing).

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Replace vi.hoisted() pattern with standard mock variable declarations
following the same pattern used in other stable tests (SelectAction,
settingsService, etc). This approach:

- Declares mock variables outside describe block
- Initializes them in beforeAll() instead of vi.hoisted()
- Avoids potential timing issues in CI environments
- Maintains same test coverage and assertions

The vi.hoisted() approach worked locally but showed intermittent
failures in GitHub Actions due to module import timing. This pattern
has proven stable across other test files.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…eanup

Critical Bug Fix:
- Previously deleted entire session folder when removing one element
- Now deletes only the specific file by nodeId, preserving other elements
- Automatically cleans up empty session folders to prevent clutter

Implementation:
- Split deleteSignatureElement into two distinct paths:
  * IUser: uses UserElementMapper with DB lookup by user_id + node_id
  * Non-IUser: uses deleteSignatureElementFromSession with strict validation
- New deleteSignatureElementFromSession() method:
  * Validates session folder exists before attempting deletion
  * Uses getFirstNodeById() to ensure element is within session folder
  * Checks element is a File (not Folder or other Node type)
  * Deletes only the specific file by nodeId
  * Cleans up empty session folder after last element deletion
  * Throws DoesNotExistException if element not found

Security Improvements:
- Prevents deletion of files outside session scope
- Validates node type before deletion
- Maintains proper separation of authenticated vs unauthenticated flows

Test Coverage:
- Added 8 comprehensive unit tests (all passing):
  * testDeleteSignatureElementWithUserDeletesFromDB
  * testDeleteSignatureElementWithUserWhenFileNotFound
  * testDeleteSignatureElementWithoutUserDeletesFromSession
  * testDeleteSignatureElementWithoutUserThrowsWhenSessionFolderNotFound
  * testDeleteSignatureElementWithoutUserThrowsWhenNodeNotInSession
  * testDeleteSignatureElementWithoutUserThrowsWhenNodeIsNotFile
  * testDeleteSignatureElementOnlyDeletesSpecificFileNotWholeFolder
  * testDeleteSignatureElementDeletesEmptySessionFolder
- Tests validate security logic, error handling, and cleanup behavior
- Integration tests (Behat) already cover end-to-end scenarios

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
… files by nodeId

Critical fix for CI test failure 'CRUD of signature element to guest' returning 404 on DELETE.

Root cause: Guests save signature files in appdata (guest_app/<userId>), not in their
getUserFolder. The original getFileByNodeId() tried to search getUserFolder first for
ALL authenticated users, including guests. This search would fail for guests but could
return false positives or fail silently, causing subsequent operations to fail.

When getUserElements() calls signatureFileExists() → getFileByNodeId() with a guest
userId, the method would search in the wrong location, leading to:
1. Files not found during GET (though fallback sometimes worked)
2. Database records incorrectly deleted as 'orphaned'
3. DELETE operations returning 404 'Element not found'

Solution: Check if user is in 'guest_app' group before attempting getUserFolder search.
For guests, skip directly to appdata search path which is their correct storage location.

Storage paths by user type:
- Normal user: getUserFolder (e.g., /files/username/LibreSign/)
- Guest user: appdata (e.g., appdata_*/libresign/guest_app/<userId>/)
- Unauthenticated: appdata (e.g., appdata_*/libresign/unauthenticated/)

The fix ensures guests' files are found in their correct appdata location, preventing
the cascade of failures that led to 404 errors on DELETE operations.

Fixes: https://github.com/LibreSign/libresign/actions/runs/21969295590
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos force-pushed the chore/bump-dependencies branch from bab93e9 to 01ae73d Compare February 13, 2026 01:16
@vitormattos vitormattos merged commit a1cbae3 into main Feb 13, 2026
70 checks passed
@vitormattos vitormattos deleted the chore/bump-dependencies branch February 13, 2026 01:27
@github-project-automation github-project-automation Bot moved this from 0. Needs triage to 4. to release in Roadmap Feb 13, 2026
@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable33

@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable32

@backportbot-libresign
Copy link
Copy Markdown

The backport to stable33 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable33
git pull origin stable33

# Create the new backport branch
git checkout -b backport/6825/stable33

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 9c92f23f 1552a870 b35577e5 432e4342 5e36dead fe2c76cb db621de2 6dc40393 ebb9abfb 5621ff35 01ae73de

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/6825/stable33

Error: Failed to push branch backport/6825/stable33: To https://github.com/LibreSign/libresign.git
! [remote rejected] backport/6825/stable33 -> backport/6825/stable33 (refusing to allow a GitHub App to create or update workflow .github/workflows/behat-mariadb.yml without workflows permission)
error: failed to push some refs to 'https://github.com/LibreSign/libresign.git'


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot-libresign
Copy link
Copy Markdown

The backport to stable32 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable32
git pull origin stable32

# Create the new backport branch
git checkout -b backport/6825/stable32

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 9c92f23f 1552a870 b35577e5 432e4342 5e36dead fe2c76cb db621de2 6dc40393 ebb9abfb 5621ff35 01ae73de

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/6825/stable32

Error: Failed to push branch backport/6825/stable32: To https://github.com/LibreSign/libresign.git
! [remote rejected] backport/6825/stable32 -> backport/6825/stable32 (refusing to allow a GitHub App to create or update workflow .github/workflows/behat-mariadb.yml without workflows permission)
error: failed to push some refs to 'https://github.com/LibreSign/libresign.git'


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant