Skip to content

Conversation

@existentialcoder
Copy link

Description

  • Every time a new shared link is accessed with a password, two redundant calls are made to list the files
  • The first one is a watcher listener and a second is to verify password
  • This PR makes sure the watcher triggers the network call only during password verification.

Related Issue

Motivation and Context

Removed a duplicated call for the files-list when accessing a password protected shared link

How Has This Been Tested?

Unit and manual tests

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests
  • Documentation
  • Maintenance (e.g. dependency updates or tooling)

Open tasks:

  • ...

@update-docs
Copy link

update-docs bot commented Dec 26, 2025

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@CLAassistant
Copy link

CLAassistant commented Dec 26, 2025

CLA assistant check
All committers have signed the CLA.

@sonarqubecloud
Copy link

@LukasHirt LukasHirt self-requested a review December 29, 2025 08:41
Copy link
Collaborator

@LukasHirt LukasHirt left a comment

Choose a reason for hiding this comment

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

Could you please add unit tests to verify that the change prevent the second call?

@LukasHirt LukasHirt changed the title fix: Duped call for public share access with p/w fix: [OCISDEV-554] duped call for public share access with p/w Dec 29, 2025
@existentialcoder
Copy link
Author

existentialcoder commented Dec 29, 2025

Could you please add unit tests to verify that the change prevent the second call?

Trying to get an idea here. @LukasHirt

The authService is actually mocked in the test and therefore the watcher won't be triggered.

Can the authService test file instead include this test since the changes are added there? TIA

Btw a screenshot from manual test

image

@LukasHirt
Copy link
Collaborator

I took a closer look now and see that the index file is anyway not yet covered with unit tests at all. There's quite a lot happening in that file so adding the tests would take a bit longer than I originally thought. If you have an idea for a simple tests somewhere else that would cover your changes, feel free to add them. Otherwise I would be fine with just doing manual testing and leaving unit tests for now.

@existentialcoder
Copy link
Author

I took a closer look now and see that the index file is anyway not yet covered with unit tests at all. There's quite a lot happening in that file so adding the tests would take a bit longer than I originally thought. If you have an idea for a simple tests somewhere else that would cover your changes, feel free to add them. Otherwise I would be fine with just doing manual testing and leaving unit tests for now.

Yeah. I will check and add it in the authService test. Also getting your opinion on whether these duplicate calls are to be removed post successful password submission. These are after routing to the public share directory

image

@LukasHirt
Copy link
Collaborator

Yes, if there are more duplicate calls we should handle those as well. If the fix for it is simple, I would include it in this PR. If it's a bit more complex, I would suggest separate PR.

@existentialcoder
Copy link
Author

Yes, if there are more duplicate calls we should handle those as well. If the fix for it is simple, I would include it in this PR. If it's a bit more complex, I would suggest separate PR.

Yes can be taken separately. As you mentioned this needs a separate test file for index.ts. Should we take this PR without the test?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OCISDEV-554] Password protected share gets authenticated twice

3 participants