Giter Club home page Giter Club logo

httprelayjs-gui's Introduction

httprelayjs-gui's People

Contributors

kurtpachinger avatar

Watchers

 avatar

httprelayjs-gui's Issues

client connect results in malformed log

  1. single client failed to connect with single large image.
  2. client eventually connected initially under uid+c.
  3. server had no errors and no auth block for standard uid.
  4. server/client event logs malformed. init event replaced with image:
  • client: init e[0]: time, value, id, init:false
  • server: init e[0] same as client, also init e[1]: time, id, init:false

session otherwise receives fetch until:

  • successive push log to master has no event.indexOf

testing - running list

general issues

  • reconnect
  • purge
  • pull_hard: new peer auth prior peers: events prior to connect HEAD (unless blocked)
  • revlist: timestamp, prune, auths, timeout intervals
  • client onload race condition where sm undefined

sm.img return value

  • server master log does not replace image with tiny thumbnail, but only stores a link id. This is good... but the function should return the base64, not null, when required (async/await or function parameter reference lost). 9374536
  • file extension honors type cb060aa
  • improve compression technique: c28aa5a
sm.img = function( img, token, opts={} ){
  let pass = opts.pass || (1/2);

  // initially resize image/canvas to max dimension
  // canvas.width, canvas.height, ctx.drawImage

  let file, inc = 0.1;
  let types = opts.type ? [opts.type] : [ "image/jpeg", "image/png", "image/webp" ];
  for( let i=0; i<types.length; i++ ){
    let type = types[i];
    for( let j=1; j>=0; j-=inc ){
      // increment (dimension/quality) until within max filesize
      // canvas.width, canvas.height, ctx.drawImage
      let thumb = canvas.toDataURL(type, j);
      if( thumb.length <= 19_200 ){
        // use additional iteration if > 25% reduction
        let thumberer = canvas.toDataURL(type, j-inc);
        thumb = (thumberer.length/thumb.length<0.75) ? thumberer : thumb;
        // return smallest filesize of filetypes
        file = (thumb.length<file.length) ? thumb : file;
        break;
      }
    }
  }
 
}
// server fetch or interval
if( !image.archive && ( uid.blocked || (time - image.time) >= 60_000*15 ) ){
  sm.img( image, image.id, { archive:true, serve:image } )
}

// prioritize degrade of archive, non-cumulative
if( opts.archive ){
  pass *= (1/2);
  opts.serve.archive = true;
}

server auth does not deny client onbeforeunload

Client onbeforeunload (despite partial browser support) used to consistently block the uid. Several feature updates have affected this, unless the condition was preexisting and went unnoticed. Is inconsistent behavior of auth uid block due to server state(s)... parallel instance, sleep, or...?

Auth was expanded from a generic uid array to an object. This allowed a connect handshake, queue, and pull_hard for events prior to connect event timestamp. Blocked uid is no longer assured, thanks to this change among others (code refactor, reconnect, multi-part, pull_hard).

server errors - running list

fatal

  • server exceptions to own uid as client
  • queue: host crashes if client in queue and unloads + (host connect as client)
  • user (without events?) is blocked on timeout and reconnects. mutated uid key mismanaged in master log lookup.

non-fatal

  • revlist: duplicate event send... (several images) for clients who connect later

feature

  • fetch Promise.all: avoid missed sends in excess of limit
  • exposing code to client publicly

config reduction

limit duplicate or unnecessary fetch data, with respect to code bloat:

  • client multi-part (user info)
  • server with no update (empty peers)

server: unload events and archive images

  • pull_hard should include denied uid OR log events should be pruned?
  • reduce quality of archived images
// server fetch or interval
if( !image.archive && ( uid.blocked || (time - image.time) >= 60_000*15 ) ){
  sm.img( image, image.id, { archive:true, serve:image } )
}

// prioritize degrade of archive, non-cumulative
if( opts.archive ){
  pass *= (1/2);
  opts.serve.archive = true;
}

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.