Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • funkwhale funkwhale
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 380
    • Issues 380
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • funkwhalefunkwhale
  • funkwhalefunkwhale
  • Merge requests
  • !837

Added "refresh=true" API param to artist, track and album detail to retrieve up-to-date data if needed

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Agate requested to merge refetch-remote-entities into develop Jul 22, 2019
  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 9

Even if we broadcast Update messages over federation when changes are submitted on artists, albums and tracks, it's still possible that other pods get out of sync (e.g if a pod is down when receiving the message).

To mitigate this, this MR implements basic refetching. When retriving an artist, album or track via the API, if you provide a ?refresh=true parameter and the entity comes from a remote pod, then Funkwhale will fetch the most up-to-date data before returning it to you. If fetching this data fails for any reason (e.g the remote pod is down), then we return the currently available data.

To avoid abuse and limit the traffic on remote pods, this can only occur once every FEDERATION_OBJECT_FETCH_DELAY minutes (defaults to three day) for each entity.

The front-end has been updated to pass refresh=true by default.

cc @funkwhale/reviewers-python

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: refetch-remote-entities