Coder Social home page Coder Social logo

eris-sharder's People

Contributors

acollierr17 avatar anothergenz avatar bsian03 avatar dependabot-preview[bot] avatar dependabot-support avatar greenkeeper[bot] avatar knht avatar letrovoes avatar melmsie avatar pikadude avatar qbunt avatar rastating avatar ssmmiles avatar tiagodanin avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

eris-sharder's Issues

IPC methods are not rejected if no resource can be found

Methods on the IPC class that return promise such as fetchMember, fetchGuild, fetchUser and fetchChannel are never rejected if no resource is found.

This means that code waiting on such promises can hang indefinitely, even if all clusters have received the message and do not have the requested resource in their cache.

I have two suggestions:

  • the promises have some form of timeout, that rejects the promise after a user-configurable time (e.g. an additional option passed to the Master class called ipcTimeout)
  • each cluster returns a response, with the value as null and if none provide a value other than null, resolve to null.

This would mean that the code calling the IPC methods would not be waiting indefinitely, and provides a less confusing experience when working with eris-sharder

[feature request] allow extending Eris.Client

I'm not sure how I want to see this happen, but it'd be useful to be able to provide eris-sharder with an Eris.Client object instead of having to add props to an already connected client.

Eris-sharder logs back in twice

I've been using eris-sharder in a staging-environment for a month or two now, and recently deployed it to production as well. During the staging period, i noticed quite a few shards disconnections, though eris-sharder re-connected almost instantly so it wasn't an issue.

Two days ago however, sometimes when a shard got disconnected, eris-sharder would reconnect like expected but log in twice

image

(Please ignore the weeb background)
The circled parts are the logs when the readyevent is emitted, as you can see, it is emitted two times.
The resulting issue is that it create two instances of the bot, therefore double commands outputs and such.

After discussing with an other dev using eris-sharder, i learned that they had the same issue, so an issue within my code is unlikely.

So far i could only see the issue happen on staging environment, on a single-sharded bot, the production bot didn't logged in twice (yet, at least).

As it only started happening 2 days ago, i suspect the issue happen when Discord does something wrong and do not properly disconnect the shard, though that's the only lead i have.

Error While executing:

I've been trying to install this package and all I keep getting is this error:

npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://[email protected]/discordware/eris-sharder.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users...\AppData\Roaming\npm-cache_logs\2020-07-26T13_49_47_630Z-debug.log

Could you please help me fix this or tell me whats up?

An in-range update of eris is breaking the build 🚨

Version 0.8.6 of eris was just published.

Branch Build failing 🚨
Dependency eris
Current Version 0.8.5
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

eris is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes 0.8.6

Additions:

  • closeVoiceConnection() – leave voice channels by voice connection ID (guild ID) (c68b07f)

Fixes:

  • Bots will now display as offline immediately after using Client.disconnect() (4ed20e9)
  • Fixed Message.cleanContent for custom emoji and system messages (eb234f8)
  • Fixed slow reaction ratelimiting (23ec4da)
  • Added oldRole.mentionable to guildRoleUpdate event (0e888b4)
  • Fixed duplicate presence handling (0f570be)
  • Fixed command overwriting in CommandClient (5fc5f1a)
  • Fixed content for system welcome messages (347458f)
  • Fixed handling of .ogg files with non-Opus audio tracks (de56b53)
Commits

The new version differs by 14 commits.

  • 4e229d5 0.8.6
  • e30f023 Bump ws dependency
  • 5fc5f1a Prevent command overwriting in CommandClient (#389)
  • 5cd3c2d Fix PermissionOverwrite docs, lint
  • 0e888b4 Add role.mentionable to guildRoleUpdate (#387)
  • 23ec4da Remove global reaction ratelimit (#388)
  • eb234f8 Update Message.cleanContent (fix #377) (#378)
  • 4ed20e9 Send WS close code 1000 on Shard.disconnect() (#383)
  • 0f570be Change how duplicate presences are detected (#376)
  • de56b53 Fix OggOpusTransformer for multi-track files (#380)
  • c68b07f Added closeVoiceConnection() (#368)
  • 347458f Add new system messages (#375)
  • af2619c Remove ImageSizes array and fix minimum image size
  • 09e420c Typings: Renamed dynamicIconURL in User to dynamicAvatarURL (#373)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Typescript support

I am using eris with typescript.
But this library doesn't support typescript.

So I request to add typescript typing files!

Error: 4000: Unknown error

Shard 0 | Error: 4000: Unknown error. at Shard._onWSClose (C:\Users\User\Desktop\Eris-Atago\node_modules\eris\lib\gateway\Shard.js:1855:23) at WebSocket.emit (events.js:315:20) at WebSocket.emitClose (C:\Users\User\Desktop\Eris-Atago\node_modules\ws\lib\websocket.js:198:10) at TLSSocket.socketOnClose (C:\Users\User\Desktop\Eris-Atago\node_modules\ws\lib\websocket.js:886:15) at TLSSocket.emit (events.js:327:22) at net.js:674:12 at TCP.done (_tls_wrap.js:567:7)

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Message files do not work with an array of file objects

The Problem

When adding files as an array to the createMessage function, files do not display correctly as they contain errors. This happens even though each item in the array is a correct file object that works if sent individually.

Example

Running this function:

msg.channel.createMessage("Some images:", [
	{ file: readFileSync("./assets/images/PauseChamp.png"), name: "PauseChamp.png" },
	{ file: readFileSync("./assets/images/PagChomp.png"), name: "PagChomp.png" }
]);

Returns this:
image
If these files are attempted to be downloaded, a webpage displays, "The image cannot be displayed because it contains errors."

Fix

if (file && Array.isArray(file)) {
    file.forEach(function(f) {
        f.file = Buffer.from(f.file, 'base64');
    });
};

I was able to find a quick fix that allows both images to be sent. This is by adding the previous lines into the files /src/sharding/clustermanager.js and /src/structures/SyncedRequestHandler.js after,

if (file && file.file) file.file = Buffer.from(file.file, 'base64');

and

if (file && file.file) file.file = Buffer.from(file.file).toString('base64');

respectively.

Logging objects

Any object I log is [object Object], could it be parsed as a proper object when printing?
I.E: console.log({ 1: 2 }) -> { 1 : 2 } in console.
Right now: console.log({ 1: 2 }) -> [object Object] in console.
Same for process.send().

Add more features

Make any pull requests with any features you would want in eris-sharder and I'll look over it.

Cleanup README

Cleanup the readme, make it more organized and structured.

lastShardID is -1 if shardCount is 0 (default)

shardCount defaults to 0 if not specified. If lastShardID is also not specified, then it defaults to shardCount - 1, which is -1, and therefore causes errors, issues, and unexpected behaviour. The example at the bottom of the README has this issue.

Setup Airbrake for your Node application

Installation

Using npm

npm install airbrake

Manual

{
  "dependencies": {
    "airbrake": "~2.0.0"
  }
}

Basic example

This is the minimal example that you can use to test Node Airbrake with your project.
The common use case for this module is to catch all 'uncaughtException' events on the process object and send them to Airbrake (You can find your project ID and API KEY with your project's settings):

var airbrake = require('airbrake').createClient(
  '<Your project ID>', // Project ID
  '<Your project API KEY>' // Project key
);
airbrake.handleExceptions();

throw new Error('I am an uncaught exception');

Note: the above will re-throw the exception after it has been successfully delivered to Airbrake, causing your process to exit with status 1.

If you want more control over the delivery of your errors, you can also manually submit errors to airbrake:

var airbrake = require('airbrake').createClient(
  '<Your project ID>', // Project ID
  '<Your project API KEY>' // Project key
);
var err = new Error('Something went terribly wrong');
airbrake.notify(err, function(err, url) {
  if (err) throw err;

  // Error has been delivered, url links to the error in airbrake
});

For more information please visit our official GitHub repo.

Attempts to start shards before knowing how many shards to start when shardCount is auto

If the shardCount is set to 0, then the following if statement results to true allowing the code to run which gets a recommended amount of shards to run. (src/sharding/clustermanager:193)

if (this.shardCount === 0) {
    this.eris.getBotGateway().then(result => {
        this.calculateShards(result.shards).then(shards => {
            this.shardCount = shards;
            this.lastShardID = this.shardCount - 1;
        });
    });
}

logger.info("Cluster Manager", `Starting ${this.shardCount} shards in ${this.clusterCount} clusters`);

let embed = {
    title: `Starting ${this.shardCount} shards in ${this.clusterCount} clusters`
}

this.sendWebhook("cluster", embed);

master.setupMaster({
    silent: true
});

// Fork workers.
this.start(0);

However, the code inside of the if statement is asynchronous, which means that the code after the if statement will most likely run before the code inside of the if statement finishes, resulting in the program effectively hanging and returning a message similar to Cluster Manager | Starting 0 shards in 12 clusters since shardCount is still set to 0. While this may not happen in environments with ultra-fast internet, the chances of this happening are still very likely.

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml
  • The new Node.js version is in-range for the engines in 1 of your package.json files, so that was left alone

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Shard disconect

Hello,
I've got a problem with Is Shards. All they do is disconnect.
Error: Connection reset by peer

Operating system : debian 9,
Processors: x64 Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz,
Core: 6,
Nodejs: 12.16.1,
Eris-sharder: 1.9.0,

Bot:
Guild: 3,749
shards: 4
Cluster: 1

2020-03-10_09h15_20

TypeError: Cannot read property '0' of undefined

I have tried the example, and when spawning 4 shards in 4 clusters (it says in log), it ends up with saying TypeError: Cannot read property '0' of undefined.. The stacktrace is pointed at the util/queue.js line 19 and the colum 30..

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.