Skip to content
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

Fix federated group shares when no longer found in remote server #44587

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Commits on Apr 2, 2024

  1. refactor: Switch local and remote server roles

    This will be needed to add tests with unavailable servers, as the local
    server is started by the script that runs the tests rather than from the
    test features themselves, so only the remote server can be stopped and
    started again.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    ccbe85b View commit details
    Browse the repository at this point in the history
  2. test: Add integration test for federated share with unavailable server

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    3d9242c View commit details
    Browse the repository at this point in the history
  3. test: Add integration tests for federated shares with temporary down …

    …server
    
    Once the receiver server is up again trying to access the federated
    share should cause it to be removed in the receiver server as well, as
    it will be no longer found in the sharer server.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    7437fd6 View commit details
    Browse the repository at this point in the history
  4. test: Add integration tests for federated shares from temporary down …

    …server
    
    Once the sharer server is up again the federated share will be still
    there, as the sharer server missed the notification from the receiver
    server about deleting the share.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    2b1cc55 View commit details
    Browse the repository at this point in the history
  5. fix: Clear remote shares between scenarios

    Although groups are removed after each scenario it seems that their
    remote group shares are not, so there might be dangling remote group
    shares that could interfere with the following scenarios. To solve that
    a new endpoint is added to the "testing" app to explicitly clear the
    remote shares.
    
    Note that any dangling remote storage was already removed with the OCC
    command, so only the "share_external" table is cleared.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    b15de31 View commit details
    Browse the repository at this point in the history
  6. test: Add integration tests for deleting federated group shares from …

    …remote
    
    When a member of the group that received a federated group share removes
    it the share is just removed for that specific user, but it does not
    affect other users in the group. Due to that the share is simply marked
    again as pending for that user.
    
    This even applies when the remote server is no longer reachable, as it
    is not possible to know if the server is just temporarily down or gone
    forever.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    19f7134 View commit details
    Browse the repository at this point in the history
  7. test: Add integration tests for deleting federated group shares with …

    …remote
    
    When the sharer removes a federated group share it is removed for all
    the members of the group that received it. Due to that, if the remote
    server was temporary down when the share was removed but once it is
    running again a user tries to access the share should be removed for all
    of them, rather than being marked as pending for that user (which is not
    the current behaviour and will need to be fixed in a follow up commit).
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    514ce86 View commit details
    Browse the repository at this point in the history
  8. fix: Fix federated group shares when no longer found in remote server

    When a federated group share with another server is deleted a
    notification is sent to the remote server to delete the share. If that
    notification is not received then when the remote server tries to access
    the share again it will not be found in the sharer server, so it will be
    locally unshared in the remote server.
    
    This works fine for user shares, as in that case the share is deleted in
    the remote server, but locally unsharing a received federated group
    share only marks it as pending again for the user that tried to access
    it. Due to that the received federated group share is left dangling in
    the remote server, and it is kept forever in the list of pending shares
    for the users in the group.
    
    To solve that now the received federated group share is fully removed
    instead of simply unshared when no longer available in the sharer server.
    
    Note that all of the above applies only when the sharer server is still
    available and it returns a "not found" (or "forbidden") error when the
    remote server tries to access the share. If the sharer server is not
    available accessing the received share does not fully remove the group
    share, as in that case it is not possible to know if the sharer server
    is temporarily unavailable or gone forever.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    86947cb View commit details
    Browse the repository at this point in the history
  9. refactor: Add another user and group to the test case

    This will be needed to test group shares with several users, as the
    external share managers returned by "createManagerForUser" use the group
    manager stored in the test case attribute.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    ad659f3 View commit details
    Browse the repository at this point in the history
  10. refactor: Make test group share parameters configurable

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    74e8524 View commit details
    Browse the repository at this point in the history
  11. refactor: Make external share manager for test group share configurable

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    3749b31 View commit details
    Browse the repository at this point in the history
  12. test: Add unit tests for removing federated group shares

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    718560a View commit details
    Browse the repository at this point in the history