Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: paravoid/ircstream
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: paravoid/ircstream
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: feature/sse
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 5 commits
  • 31 files changed
  • 1 contributor

Commits on Oct 28, 2024

  1. Add rcfmt.RecentChangeIRCFormatter

    Python reimplementation of MediaWiki's IRCColourfulRCFeedFormatter,
    lacking a few minor features (like interwiki prefixes).
    paravoid committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    b821ce4 View commit details
    Browse the repository at this point in the history
  2. rcfmt: update LEGACY_CHANNEL_MAP

    Our version predated commit 1aa6b0a897858f9185ec472e04a81445561a51e0
    (Wed Aug 3 16:55:45 2022 -0700), in which legacy wgRC2UDPPrefix
    overrides for private wikis were removed.
    paravoid committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    c8a299d View commit details
    Browse the repository at this point in the history
  3. Add SSE support

    Add an Server-Sent Event handler, utilizing the EventStreams
    (stream.wikimedia.org) service, and the aiohttp-sse-client Python
    library.
    
    This allows ircstream to be used outside of the MediaWiki Wikimedia
    production infrastructure, or any MediaWiki infrastructure for that
    matter. Events will be consumed in realtime using HTTP SSE, formatted
    according to the long-standing legacy format, and broadcasted to
    connected IRC clients.
    
    This is considered WIP, as there are several limitations:
    * stream.wikimedia.org has relatively short timeouts and disconnects
      clients periodically. While resumption
      closed is possible, it's not currently possible to do so due to both
      server and client library limitations. Therefore, messages may (and
      most likely will) be lost between disconnection and reconnection.
    * A lot of effort has gone into adequate error handling in general but
      the code has not been battle-tested. Expect (but report) crashes.
    * There are other missing features such as Special page localization and
      #centralauth that will be different from rc2udp.
    paravoid committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    9968428 View commit details
    Browse the repository at this point in the history
  4. sse: replace aiohttp_sse_client with a custom implementation

    The aiohttp_sse_client library was a bit of a pain to use, as were the
    other libraries it was inspired from (aiosseclient, sseclient, and
    sseclient-py).
    
    (I know because I've used *all of them* over the years, through commits
    that never saw the day. This is implementation v5).
    
    The code is loosely based on aiohttp_sse_client. Overall, this:
    * Simplifies a lot of the error handling by avoiding
      try/except/raise/try/except chains; exceptions are handled closer to
      the caller now.
    * Makes the code easier to reason about, e.g. EventSource was both an
      async context manager and an async iterator.
    * Modernizes the code a bit (attrs -> dataclasses)
    * Avoids the extra subclassing/overrides, and makes the last_event_id
      persistence much nicer.
    * Reduces the total SLOC count, and hopefully number of bugs, by quite a
      bit.
    paravoid committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    06103bf View commit details
    Browse the repository at this point in the history
  5. sse: drop custom SSEBroadcaster logger

    Now that ircstream.sse only has one logger, no need to specify a custom
    class logger.
    paravoid committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    30ede1c View commit details
    Browse the repository at this point in the history
Loading