Add Mastodon bot to Ticketfrei 3 #2

Merged
missytake merged 32 commits from mastodon into development 2023-03-19 19:31:03 +00:00
Owner
  • Create push & poll flows
  • Create DB model
  • Create web routes to create and delete accounts
  • Generate openAPI routes
  • Design angular components for the frontend
  • Test the backend flow
  • Write test for the API

Anything missing?

Feedback welcome :)

- [x] Create push & poll flows - [x] Create DB model - [x] Create web routes to create and delete accounts - [x] Generate openAPI routes - [x] Design angular components for the frontend - [x] Test the backend flow - [x] Write test for the API Anything missing? Feedback welcome :)
missytake added 3 commits 2022-03-01 17:40:56 +00:00
missytake added 1 commit 2022-03-01 21:20:35 +00:00
missytake added 1 commit 2022-03-02 19:43:27 +00:00
missytake added 1 commit 2022-03-03 19:09:39 +00:00
missytake added 1 commit 2022-03-04 17:16:40 +00:00
missytake force-pushed mastodon from 4d105676c2 to f66375cd77 2022-03-05 22:23:40 +00:00 Compare
missytake force-pushed mastodon from f66375cd77 to 48b177d51e 2022-03-06 09:28:05 +00:00 Compare
missytake added 1 commit 2022-03-06 09:55:29 +00:00
missytake added 9 commits 2023-03-18 12:52:34 +00:00
missytake force-pushed mastodon from bcc3f442ed to d72a23781d 2023-03-18 16:30:34 +00:00 Compare
missytake added 2 commits 2023-03-18 16:41:41 +00:00
missytake added 4 commits 2023-03-18 20:25:16 +00:00
missytake added 2 commits 2023-03-18 21:01:20 +00:00
juergen added 2 commits 2023-03-19 00:53:48 +00:00
missytake reviewed 2023-03-19 10:36:06 +00:00
@ -0,0 +78,4 @@
await self.publish(Message(text))
await get_event_loop().run_in_executor(
None, self.account.notifications_dismiss, status["id"]
)
Author
Owner

I like dismissing old notifications on the platform instead of keeping track of last_seen ourselves, but we didn't do this in ticketfrei2, so we need to dismiss all the past notifications during the migration.

I like dismissing old notifications on the platform instead of keeping track of `last_seen` ourselves, but we didn't do this in ticketfrei2, so we need to dismiss all the past notifications during the migration.
missytake reviewed 2023-03-19 10:43:34 +00:00
@ -0,0 +79,4 @@
await get_event_loop().run_in_executor(
None, self.account.notifications_dismiss, status["id"]
)
await sleep(self.polling_interval_sec)
Author
Owner

This is for rate limiting, I assume? We could maybe make this a bit more dynamic.

https://mastodonpy.readthedocs.io/en/stable/01_general.html#rate-limiting mentions that the default is 300 requests in 5 minutes, that would allow polling once per second instead of once per minute. But we don't know in advance how often we're gonna post, and the rate limit can be non-default.

Using the pace rate limit option is probably not possible with async? What we could use instead is the throw option to throw a MastodonRateLimitError if we run against the rate limit, request https://mastodonpy.readthedocs.io/en/stable/01_general.html#rate-limiting, and decide upon that for how long we do an await sleep().

This is for rate limiting, I assume? We could maybe make this a bit more dynamic. https://mastodonpy.readthedocs.io/en/stable/01_general.html#rate-limiting mentions that the default is 300 requests in 5 minutes, that would allow polling once per second instead of once per minute. But we don't know in advance how often we're gonna post, and the rate limit can be non-default. Using the `pace` rate limit option is probably not possible with async? What we could use instead is the `throw` option to throw a `MastodonRateLimitError` if we run against the rate limit, request https://mastodonpy.readthedocs.io/en/stable/01_general.html#rate-limiting, and decide upon that for how long we do an `await sleep()`.
Author
Owner
Or even better, use https://mastodonpy.readthedocs.io/en/stable/01_general.html#mastodon.Mastodon.ratelimit_remaining and https://mastodonpy.readthedocs.io/en/stable/01_general.html#mastodon.Mastodon.ratelimit_reset to guess how long we should sleep between requests, and if we hit a `MastodonRateLimitError`, we wait until https://mastodonpy.readthedocs.io/en/stable/01_general.html#mastodon.Mastodon.ratelimit_reset.
missytake added 1 commit 2023-03-19 11:40:14 +00:00
missytake added 1 commit 2023-03-19 12:24:55 +00:00
missytake added 1 commit 2023-03-19 12:48:03 +00:00
missytake added 4 commits 2023-03-19 13:49:30 +00:00
missytake added 1 commit 2023-03-19 16:27:14 +00:00
juergen added 3 commits 2023-03-19 17:30:51 +00:00
missytake force-pushed mastodon from a6c0b9c962 to ec0abb5e24 2023-03-19 17:55:00 +00:00 Compare
missytake changed title from WIP: add Mastodon bot to Ticketfrei 3 to Add Mastodon bot to Ticketfrei 3 2023-03-19 18:01:00 +00:00
missytake reviewed 2023-03-19 18:05:19 +00:00
@ -16,9 +17,10 @@ git_push.sh
index.ts
model/bodyAccessToken.ts
model/bodyAdmin.ts
model/bodyAdminLoginAdminLoginPost.ts
Author
Owner

Why was this removed?

Why was this removed?
missytake added 1 commit 2023-03-19 18:20:50 +00:00
missytake added 2 commits 2023-03-19 19:30:11 +00:00
missytake merged commit 64715f5aa5 into development 2023-03-19 19:31:02 +00:00
missytake deleted branch mastodon 2023-03-19 19:31:06 +00:00
missytake added this to the Feature Parity with Ticketfrei 2 project 2023-03-20 11:02:23 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: ticketfrei/ticketfrei3#2
No description provided.