409b286dc2
This pull request pulls the "surfacing" logic in `processing/workers` into a separate `surfacing` package, which exposes a `surfacer` struct with functions set on it for things like notifying, timelining, emailing, and streaming. The surfacer is then set on sub-processors, so that those sub-processors can call surfacing functions as necessary (during status creation etc). To fix issues like https://codeberg.org/superseriousbusiness/gotosocial/issues/4627, where posts are not appearing in timelines or being notified for, because they entered the instance in ways other than being POSTed to an inbox, dereferencer functions now accept an optional `newThreadEntryCallback` function that will be triggered for each *new* status dereferenced as part of (asynchronous) thread dereferencing. As such, in common race conditions where we see a status by doing parent / search / thread dereferencing *BEFORE* that status actually gets POSTed to our inbox, the status should still be timelined + notified (as appropriate). Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4627 Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4667 Co-authored-by: tobi <tobi.smethurst@protonmail.com> Co-committed-by: tobi <tobi.smethurst@protonmail.com>