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

Support pushing and receiving updates to poll tallies #10209

Merged
merged 14 commits into from
Mar 10, 2019

Conversation

ClearlyClaire
Copy link
Contributor

@ClearlyClaire ClearlyClaire commented Mar 7, 2019

  • Accept Update activities on Question objects, treating them the same way as polling those Questions
  • After a vote to a local poll with hide_totals unset has been processed, schedule a job to issue an Update to the audience of the poll (every mentioned user, everyone who has boosted the toot, everyone who has voted, and, if the poll is not a direct message, every follower). Only one job at a time can exist.
  • At the creation of a poll, schedule a task to notify its owner and send an Update to the people listed above.

screenshot_2019-03-08 dev instance 1

@ClearlyClaire ClearlyClaire force-pushed the features/poll-updates branch 5 times, most recently from 29d705a to 9fbc2b7 Compare March 7, 2019 17:29
@ClearlyClaire ClearlyClaire marked this pull request as ready for review March 7, 2019 17:38
@ClearlyClaire
Copy link
Contributor Author

ClearlyClaire commented Mar 7, 2019

Just noticing that this PR doesn't address sending the final Update when hide_totals is set.
Also, it might make sense to explicitly include all voters.

@ClearlyClaire ClearlyClaire force-pushed the features/poll-updates branch 12 times, most recently from 11ae11d to 99ccb94 Compare March 7, 2019 23:28
@Cassolotl
Copy link

Does this mean that if you boost or vote in a poll you get a notification of the results when it closes? :o If so, I love that.

@ClearlyClaire
Copy link
Contributor Author

@Cassolotl no, it only notifies the author of the poll. We could extend that to voters or people who boosted it, but I'm not sure we should do that (and it would be slightly trickier).

Also, we need to change the code so that the new notification type isn't sent to unsupporting clients (it breaks some of them).

@ClearlyClaire
Copy link
Contributor Author

Extended the notification to apply to all users who have voted, should handle both local and remote polls

@Gargron Gargron merged commit 3a92885 into mastodon:master Mar 10, 2019
Gargron added a commit that referenced this pull request Mar 12, 2019
Gargron added a commit that referenced this pull request Mar 12, 2019
…0246)

* Fix poll update handler calling method was that was not available

Fix regression from #10209

* Refactor VoteService

* Refactor ActivityPub::DistributePollUpdateWorker and optimize it

* Fix typo

* Fix typo
@ClearlyClaire ClearlyClaire deleted the features/poll-updates branch March 14, 2019 13:12
hiyuki2578 pushed a commit to ProjectMyosotis/mastodon that referenced this pull request Oct 2, 2019
* Process incoming poll tallies update

* Send Update on poll vote

* Do not send Updates for a poll more often than once every 3 minutes

* Include voters in people to notify of results update

* Schedule closing poll worker on poll creation

* Add new notification type for ending polls

* Add front-end support for ended poll notifications

* Fix UpdatePollSerializer

* Fix Updates not being triggered by local votes

* Fix tests failure

* Fix web push notifications for closing polls

* Minor cleanup

* Notify voters of both remote and local polls when those close

* Fix delivery of poll updates to mentioned accounts and voters
hiyuki2578 pushed a commit to ProjectMyosotis/mastodon that referenced this pull request Oct 2, 2019
…stodon#10246)

* Fix poll update handler calling method was that was not available

Fix regression from mastodon#10209

* Refactor VoteService

* Refactor ActivityPub::DistributePollUpdateWorker and optimize it

* Fix typo

* Fix typo
messenjahofchrist pushed a commit to Origin-Creative/mastodon that referenced this pull request Jul 30, 2021
* Process incoming poll tallies update

* Send Update on poll vote

* Do not send Updates for a poll more often than once every 3 minutes

* Include voters in people to notify of results update

* Schedule closing poll worker on poll creation

* Add new notification type for ending polls

* Add front-end support for ended poll notifications

* Fix UpdatePollSerializer

* Fix Updates not being triggered by local votes

* Fix tests failure

* Fix web push notifications for closing polls

* Minor cleanup

* Notify voters of both remote and local polls when those close

* Fix delivery of poll updates to mentioned accounts and voters
messenjahofchrist pushed a commit to Origin-Creative/mastodon that referenced this pull request Jul 30, 2021
…stodon#10246)

* Fix poll update handler calling method was that was not available

Fix regression from mastodon#10209

* Refactor VoteService

* Refactor ActivityPub::DistributePollUpdateWorker and optimize it

* Fix typo

* Fix typo
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.

3 participants