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

[feature] add support for polls + receiving federated status edits #2330

Conversation

NyaaaWhatsUpDoc
Copy link
Member

@NyaaaWhatsUpDoc NyaaaWhatsUpDoc commented Nov 2, 2023

Description

Adds support for the following features:

  • creating, voting in polls via the API
  • sending federating poll votes
  • receiving federated poll updates
  • receiving federated status updates
  • notifying users of poll ends (both local and federated)

Closes:
#1579
#1990

Continuing where #2237 was closed, but with less horrific commit history. (I lost count of the number of rebases on that PR, it was very long-running). Is currently based upon #2329 so will rebase from that when it is merged.

TODO:

  • docs on polls from an AP perspective for another PR!
  • handling federation side effects on poll vote
  • inserting poll on client API status create
  • poll scheduler + required side-effects
  • add necessary database migration
  • finish writing docs for code comments
  • side-effects of local vote in local poll
  • side-effects of local vote in remote poll
  • side-effects of remote vote in local poll
  • final fixups (many i'm sure)
  • poll database tests
  • poll vote database tests
  • poll processor test
  • poll vote processor test
  • AS status w/ poll tests
  • AS poll vote tests

Notes:

  • more robust AS tests will come in a later PR (soon)
  • support for visible polls in the frontend will come in a later PR (soon)
  • docs on polls from an AP perspective will come in a later PR (soon)
  • support for edited status revision history will come in a later PR (probably much later)
  • support for editing statuses by client API will come in a later PR (probably much later)

Checklist

  • I/we have read the GoToSocial contribution guidelines.
  • I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
  • I/we have performed a self-review of added code.
  • I/we have written code that is legible and maintainable by others.
  • I/we have commented the added code, particularly in hard-to-understand areas.
  • I/we have made any necessary changes to documentation.
  • I/we have added tests that cover new code.
  • I/we have run tests and they pass locally with the changes.
  • I/we have run go fmt ./... and golangci-lint run.

@tsmethurst
Copy link
Contributor

Holy crap! It's arrived! Will get my reviewing glasses on (imagine opera glasses held on a stick while I peer at your code discerningly from up on the balcony).

Copy link
Contributor

@tsmethurst tsmethurst left a comment

Choose a reason for hiding this comment

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

Brilliant work, well done! I have some small comments but no serious changes! Can't wait to try this out!

@NyaaaWhatsUpDoc NyaaaWhatsUpDoc merged commit e9e5dc5 into superseriousbusiness:main Nov 8, 2023
2 checks passed
@NyaaaWhatsUpDoc NyaaaWhatsUpDoc deleted the feature/add-polls-support-2 branch November 8, 2023 14:32
@filipesmedeiros
Copy link

Can I please ask if this implementation will be able to get polls from older posts (from other instances), or only from the moment we upgrade?

@tsmethurst
Copy link
Contributor

It will get polls from older posts too the next time you open that post in your client :)

@filipesmedeiros
Copy link

Hey! I'm confused about something: does this PR enable seeing edits on federated posts? It seems that at least image descriptions are not updating for me :)

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.

None yet

3 participants