Giter Site home page Giter Site logo

seventv / eventapi Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 6.0 299 KB

A service which provides live updates for various resources implementing the Server-Sent Events and WebSocket specs

License: Other

Dockerfile 1.77% Go 85.65% Makefile 1.08% HCL 11.50%

eventapi's Introduction

Welcome to 7TV!

7TV is an opensource platform for emotes and other streamer related tools and services.

Contributing

If you want to contribute to this repo, please read the Contributing Guidelines.

CLA

We use a Contributor License Agreement to protect the rights of contributors.

License

This project is licensed under multiple licenses. Please see the licenses in the licenses directory for more information.

Code of Conduct

This project is governed by the Contributor Covenant Code of Conduct.

Security

If you find a security vulnerability, please read the Security Policy.

Contact

If you have any questions, please contact us at [email protected].

eventapi's People

Contributors

anatoleam avatar dependabot[bot] avatar matinaniss avatar mjfwebb avatar mrauro avatar troykomodo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

eventapi's Issues

Timestamp of pulled emotes is incorrect

When subscribing to an EventStream for the emote_set.update event, I am able to receive events as intended for emotes that are pushed, updated, and pulled. However, specifically on pulled emotes, the value of old_value.timestamp is wildly incorrect. Examples are shown below.

Given that there's no documentation describing special behavior for pulled emote timestamps, I assume this is in error. Do you have any idea why this might be occurring, or a temporary workaround to obtain the proper timestamp?

Edit to add: I also would have expected there to be a timestamp value for the pulled update itself as well, but the endpoint doesn't appear to provide one. I think this is a separate—albeit related—issue, though.

Sample pushed array:

"pushed": [
  {
    "key": "emotes",
    "index": 424,
    "type": "object",
    "value": {
      "actor_id": "omitted",
      "data": {
        "animated": true,
        "flags": 0,
        "host": {
          "files": [
            // Omitted for concision
          ],
          "url": "//cdn.7tv.app/emote/61c4ed2345ea0fdc58f68e8f"
        },
        "id": "61c4ed2345ea0fdc58f68e8f",
        "lifecycle": 3,
        "listed": true,
        "name": "programming",
        "owner": {
          // Omitted for concision
        },
        "state": ["LISTED"],
        "tags": [
          // Omitted for concision
        ]
      },
      "flags": 0,
      "id": "61c4ed2345ea0fdc58f68e8f",
      "name": "programming",
      "timestamp": 1693865677849 // <---- Correct value
    }
  }
]

Sample pulled array, for an update executed moments later:

"pulled": [
  {
    "key": "emotes",
    "index": 424,
    "type": "object",
    "old_value": {
      "actor_id": "omitted",
      "flags": 0,
      "id": "61c4ed2345ea0fdc58f68e8f",
      "name": "programming",
      "timestamp": -62135596800000 // <---- Incorrect value
    },
    "value": null
  }
]

Enabling an emote with multiple versions results in an older version being loaded in

Steps to reproduce:

  1. Open web chat with the 7TV extension enabled or a version of Chatterino with 7TV live events support
  2. Enable the latest version of an emote with multiple versions (ex. peepoChat, which has 63438a743d1bc89e0ff9e400 as the latest version's emote ID and 60a4038db0dc46d7b43df99a as the previous version's emote ID)
  3. Use the newly enabled emote

Expected result:

  • The latest version of the enabled emote (63438a743d1bc89e0ff9e400 for peepoChat) is shown

Actual result:

  • A previous version of the enabled emote (60a4038db0dc46d7b43df99a for peepoChat) is shown

Refreshing the page or reloading emotes on Chatterino will load in the correct version of the emote.

Tested with:

web.mp4
c2.mp4

emote_set.update bug ?

emote_set.update workes only with the default set not this other sets like christmas emote set. no matter if the christmas emote set is activated or not. only updates from the default emote set are shown.

Listening to user emotes

Hi,
I'm trying to subscribe to the emote_set.update however I don't get any message back, if I'm subscribed or any updates.
Probably I'm just dumb and I'm missing something.

Here is my code:

import WebSocket from 'ws';

const ws = new WebSocket('wss://events.7tv.io/v3');

const ws_sub_xanax = {
    op: 35,
    d: {
        type: "emote_set.update",
        condition: {
            object_id: "62f7c07fe760964fc08e2be8"
        }
    }
}

ws.on('open', function open() {
    ws.send(JSON.stringify(ws_sub_xanax))
});

ws.on('message', function message(data) {
  console.log('received: %s', data);
});

Add CORS to Server Errors Where Possible

At present, I'm getting a 503 response with a "server full" message from the events server, but it has no CORS headers, so my JS client can't tell what the problem is. Please add appropriate headers to this, and any other server errors, if possible, to help clients react appropriately to each type of failure.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.