profile
viewpoint

jcao219/astra 0

CS 5152

jcao219/brainwallet-check 0

Generates a bitcoin address and private key according to a 'brainwallet' string, then checks to see if the wallet is active

jcao219/cfssl 0

CFSSL: Cloudflare's PKI and TLS toolkit

fork jcao219/electrode-server

Electrode's configurable web server using Hapi.js atop Node.js

fork in 19 days

issue closedShougo/deoplete.nvim

The PyPI package msgpack has updated -- deoplete is broken on the latest version

Old version: https://pypi.org/project/msgpack-python/ (deoplete works) (deprecated)

New version: https://pypi.org/project/msgpack/ (deoplete breaks)

closed time in 19 days

jcao219

issue openedShougo/deoplete.nvim

The PyPI package msgpack has updated -- deoplete is broken on the latest version

Old version: https://pypi.org/project/msgpack-python/ (deoplete works) (deprecated)

New version: https://pypi.org/project/msgpack/ (deoplete breaks)

created time in 19 days

issue openedShougo/deoplete.nvim

support for msgpack new major version

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Problems summary

  • msgpack is now the pip package name, not msgpack-python

Expected

Environment Information

  • deoplete version (SHA1):

  • OS:

  • neovim/Vim :version output:

  • :checkhealth or :CheckHealth result(neovim only):

Provide a minimal init.vim/vimrc with less than 50 lines (Required!)

" Your minimal init.vim/vimrc
set runtimepath+=~/path/to/deoplete.nvim/
let g:deoplete#enable_at_startup = 1

" For Vim only
"set runtimepath+=~/path/to/nvim-yarp/
"set runtimepath+=~/path/to/vim-hug-neovim-rpc/

How to reproduce the problem from neovim/Vim startup (Required!)

  1. foo
  2. bar
  3. baz

Generate a logfile if appropriate

  1. export NVIM_PYTHON_LOG_FILE=/tmp/log
  2. export NVIM_PYTHON_LOG_LEVEL=DEBUG
  3. nvim -u minimal.vimrc
  4. some works
  5. cat /tmp/log_{PID}

Screenshot (if possible)

Upload the log file

created time in 20 days

push eventjcao219/incubator-airflow

snyk-bot

commit sha 6d8808e9ada52cfa2ec2a3c2174e744a6277d283

fix: airflow/www_rbac/package.json & airflow/www_rbac/package-lock.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-NPM-537603 - https://snyk.io/vuln/SNYK-JS-NPM-537604 - https://snyk.io/vuln/SNYK-JS-NPM-537606

view details

push time in 4 months

push eventjcao219/fastify-server

Jimmy Cao

commit sha c78da9f9abc17ddfc934ec4c9dd1b11a4332ef0b

add comment

view details

push time in 4 months

push eventjcao219/fastify-server

Jimmy Cao

commit sha 9d12a0c36d023c934fc8ea8b4ad715622ce47d3c

create new objects per request

view details

push time in 4 months

pull request commentelectrode-io/fastify-server

reset request.app for each request

server.app will diverge from request.app? what's the expected behavior in this case?

I think server.app changes are supposed to persist for the entire lifetime of the application, whereas request.app should be per-request

jcao219

comment created time in 4 months

push eventjcao219/fastify-server

Joel Chen

commit sha f6f9c083dcfa543962d707dfdcc4fee10e7eff80

update/cleanup tests (#6) * update/cleanup tests * stop server in afterEach * fix verify

view details

Jimmy Cao

commit sha 8fc12f65f6b115f230dde4bf13ff6c650b7977f0

reset request.app for each request

view details

Jimmy Cao

commit sha e819df94367a3d588d2a7360dbad0afff8e4c03a

add test

view details

Jimmy Cao

commit sha a5f68bd05019fe86dc5b5eaa7a1bc13184f17a30

update test

view details

push time in 4 months

push eventjcao219/fastify-server

Joel Chen

commit sha f6f9c083dcfa543962d707dfdcc4fee10e7eff80

update/cleanup tests (#6) * update/cleanup tests * stop server in afterEach * fix verify

view details

push time in 4 months

pull request commentelectrode-io/fastify-server

reset request.app for each request

I'm not sure why the CI is failing. The line number in the logs for the error doesn't seem to make sense, and clap check works fine locally.

jcao219

comment created time in 4 months

push eventjcao219/fastify-server

Jimmy Cao

commit sha 2211a85d552aed59e3bf540def70c3f2b4dbcc62

Try rerunning CI

view details

push time in 4 months

push eventjcao219/fastify-server

Jimmy Cao

commit sha a77226b029d015c21d9bd28d2fc35012b942dae6

add test

view details

push time in 4 months

PR opened electrode-io/fastify-server

reset request.app for each request

problem

currently, request.app will persist through multiple requests we want to mimic the behavior of Hapi's request.app

e.g. right now:

  server.route({
    method: "GET",
    path: "/",
    handler: (req, reply) => {
      if (!req.app.initComplete) {
          performInit(req);
          req.app.initComplete = true;
      }
      reply.send("hello world");
    }
  });

initComplete gets set to true during the first request, and all requests thereafter will not do the initialization logic. This diverges from Hapi's behavior where request.app is a fresh object for each request.

fix

In a onRequest hook reset request.app to the original object { config: appConfig }

what's the point of fastify.decorateRequest then?

I think it also works if you delete the line fastify.decorateRequest('app', ...) in lib/app-context.js

but using the decorateRequest API allows fastify to optimize for performance, and also probably enables the decorator-dependency-checking feature described here

See https://github.com/fastify/fastify/blob/master/docs/Decorators.md#usage-notes

concern

I hope that the lifecycle hooks run in the order that they are added, so that subsequent hooks added by other plugins will also have access to the request.app object

+10 -3

0 comment

1 changed file

pr created time in 4 months

push eventjcao219/fastify-server

Jimmy Cao

commit sha c30defc64cabe83d2e1b1a92ea6976d6052ecdd6

reset request.app for each request

view details

push time in 4 months

create barnchjcao219/fastify-server

branch : request-app-context

created branch time in 4 months

push eventjcao219/fastify-server

Jimmy Cao

commit sha 3fc9af92de8dede139e886c6f5865f3269b02ffa

add missing dependency on fastify-plugin (#5)

view details

Joel Chen

commit sha 249cb63a17b9a5fe17f103770b016a6037def82f

github actions - nodejs.yml

view details

Joel Chen

commit sha a126d581a62ddbec39cc149035ed55c85a889dce

[ci] gh action for PR

view details

push time in 4 months

PR opened electrode-io/fastify-server

add missing dependency on fastify-plugin

this is require'd in lib/app-context.js

+2 -1

0 comment

1 changed file

pr created time in 4 months

create barnchjcao219/fastify-server

branch : fix-require

created branch time in 4 months

fork jcao219/fastify-server

Electrode using Fastify

fork in 4 months

Pull request review commentelectrode-io/fastify-server

Electrode initial implementation

+"use strict";++/* eslint-disable no-magic-numbers, prefer-template */++const assert = require("assert");+const Fastify = require("fastify");+const _ = require("lodash");+const Chalk = require("chalk");+const Path = require("path");+const checkNodeEnv = require("./check-node-env");+const logger = require("./logger.js");+const startFailed = require("./start-failed");+const appContext = require("./app-context");+const Confippet = require("electrode-confippet");+const AsyncEventEmitter = require("async-eventemitter");+const requireAt = require("require-at");+const xaa = require("xaa");++async function emitEvent(context, event) {+  const timeout = _.get(context, "config.electrode.eventTimeout");++  if (timeout && !context.emitter._events[event]) {+    return;+  }++  let promise = new Promise((resolve, reject) => {+    context.emitter.emit(event, context, err => {+      return err ? reject(err) : resolve();+    });+  });++  if (timeout) {+    promise = xaa.runTimeout(promise, timeout);+  }++  try {+    await promise;+  } catch (error) {+    const massageError = err => {+      err.timeout = timeout;+      err.event = event;+      if (err instanceof xaa.TimeoutError) {+        err.message = `timeout waiting for event '${event}' handler`;+        err.code = "XEVENT_TIMEOUT";+      } else {+        err.message = `event '${event}' handler failed: ${err.message}`;+        err.code = "XEVENT_FAILED";+      }+      return err;+    };+    throw massageError(error);+  }+}++async function convertPluginsToArray(plugins) {+  //+  // The module could either be one in node_modules or a file in a path+  // relative to CWD+  // * module in node_modules: no leading "."+  // * file in a directory, relative path with leading "." under CWD, resolve+  //   full path for require+  //+  const fullRequirePath = x => {+    return x.startsWith(".") ? Path.resolve(x) : x;+  };++  const topRequireFromPath = plugins.requireFromPath;++  assert(+    !topRequireFromPath || _.isString(topRequireFromPath),+    `config.plugins.requireFromPath must be a string`+  );++  const loadModule = async p => {+    if (p.register) return p;+    // if p.register is not defined then check p.module+    // if no p.module or p.module !== false, then use field name (p.__name)++    const getPluginModule = () => {+      const requireFromPath = p.requireFromPath;+      if (_.isString(p.module)) {+        return { name: p.module, requireFromPath };+      } else if (_.isObject(p.module)) {+        assert(p.module.name, `plugin ${p.__name} 'module' must have 'name' field`);+        assert(+          !p.module.requireFromPath || _.isString(p.module.requireFromPath),+          `plugin ${p.__name} 'module.requireFromPath' must be a string`+        );+        return Object.assign({ requireFromPath }, p.module);+      } else if (p.module !== false) {+        return { name: p.__name, requireFromPath };+      }+      throw new Error(`plugin ${p.__name} disable 'module' but has no 'register' field`);+    };++    const doRequire = async () => {+      const pluginMod = getPluginModule();+      let name;+      let mod = null;++      const requireMod = () => {+        //+        // if has a name for the module to load, then try to load it.+        //+        let fromPath = pluginMod.requireFromPath || topRequireFromPath;+        let xrequire;++        if (fromPath) {+          name = pluginMod.name;+          // use require-at to load the module from path+          xrequire = requireAt(fromPath);+          p.requireFromPath = fromPath;+          fromPath = ` from path: ${fromPath}`;+        } else {+          // use require to load the module+          xrequire = require;+          name = fullRequirePath(pluginMod.name);+          fromPath = p.requireFromPath = "";+        }+        try {+          mod = xrequire(name);+        } catch (error) {+          error.message = `Failed loading module ${pluginMod.name}${fromPath}: ${error.message}`;+          throw error;+        }+      };++      requireMod();++      // order of fields to look for the Fastify plugin from the module:+      // 1. mod.register+      // 4. mod.default (ES6)+      // 5. mod+      const plugin = ["plugin", "default"].find(x => _.get(mod, x));+      // validate plugin+      p.register = (plugin && _.get(mod, plugin)) || mod;++      const validatePlugin = pos => {+        assert(pos.register, `Plugin ${name} is a falsy value: ${pos.register}`);+        assert(typeof pos.register === "function", `Plugin ${name} should be a function`);+      };+      validatePlugin(p);+      return p;+    };++    return doRequire();+  };++  const num = x => {+    return _.isString(x) ? parseInt(x, 10) : x;+  };++  const checkNaN = x => {+    return isNaN(x) ? Infinity : x;+  };++  const priority = p => checkNaN(num(p.priority));+  const isEnable = p => p.__name !== "requireFromPath" && p.enable !== false;+  const transpose = (p, k) => Object.assign({ __name: k }, p);++  //+  // transpose each plugin, filter out disabled ones, and sort by priority+  //+  const pluginsArray = () =>+    _(plugins)+      .map(transpose)+      .filter(isEnable)+      .sortBy(priority)+      .value();+  // convert plugins object to array and check each one if it has a module to load.+  const arr = pluginsArray();+  return xaa.map(arr, loadModule);+}++async function startElectrodeServer(context) {+  const server = context.server;+  const config = context.config;+  let started = false;++  const registerPlugins = async plugins => {+    const errorRegisterMessage = plg => {+      if (plg.module) {+        const fromPath = plg.requireFromPath ? ` from path: '${plg.requireFromPath}'` : "";+        return `with module '${JSON.stringify(plg.module)}'${fromPath}`;+      } else {+        return `with register function`;+      }+    };+    const registerPromises = [];+    plugins.forEach(plg => {+      server.register(plg.register, plg.options);+      const registerStatus = new Promise((resolve, reject) => {+        server.after(err => {+          if (err) {+            if (!err.hasOwnProperty("message")) {+              err = new Error(err);+            } else if (err.code === "ERR_AVVIO_PLUGIN_TIMEOUT") {+              err.message = `plugin '${+                plg.__name+              }' with register function timeout - did you return a resolved promise?`;+            }++            err.code = "XPLUGIN_FAILED";+            err.plugin = plg;+            err.method = errorRegisterMessage(plg);++            reject(err);+          }+          resolve();+        });+      });+      registerPromises.push(registerStatus);+    });+    await server.ready();+    await Promise.all(registerPromises);

Are you sure this is needed? ready callback is called only after all plugins are registered.

datvong-wm

comment created time in 4 months

push eventjcao219/deno

Jimmy Cao

commit sha 82c222ab59c6f10b2a51e2058337fd60c60bd310

Fixes in the ts

view details

push time in 6 months

push eventjcao219/incubator-airflow

snyk-bot

commit sha 5729cd2c72c3c999af44005f089c8ecb576faf31

fix: airflow/www_rbac/package.json, airflow/www_rbac/package-lock.json & airflow/www_rbac/.snyk to reduce vulnerabilities The following vulnerabilities are fixed with a Snyk patch: - https://snyk.io/vuln/SNYK-JS-HTTPSPROXYAGENT-469131

view details

push time in 6 months

push eventjcao219/deno

Jimmy Cao

commit sha 9553a333866a254cab1fc41a1686bb36cac04862

Skip serializing fields if they are None

view details

push time in 6 months

create barnchjcao219/deno

branch : new-add-watch

created branch time in 6 months

push eventjcao219/deno

Jimmy Cao

commit sha 146469c62413b0ea21e7461834949d26e9b5f5d2

WIP: add watch

view details

push time in 7 months

issue commentdenoland/deno

fs events ops

@bartlomieju Hi all, sorry for the long delay.

I have had a working implementation, but it's been a while since I've synced it with master branch, so I'll need to update it for the new JSON message passing changes. Let me do that ASAP and get right back to y'all.

kitsonk

comment created time in 7 months

more