walmat / nebula-old

Deployment download link will be hosted here:
http://nebula-deployment.herokuapp.com
3 stars 0 forks source link

Restructuring tasks object #36

Closed walmat closed 6 years ago

walmat commented 6 years ago

I've been thinking through more of the process pipeline for tasks and I've come to the conclusion one of two things need to happen in order for me to proceed with the pipeline.

Option 1.

We need to restructure the creating tasks a bit to accommodate the "supported site" gathering. This would mean that when a user clicks submit after filling out their task information, we would gather the supported sites for that SKU (either by some custom search algorithm, or some sort of functionality we have within the discord-bot integration) and display a simple number of supported sites in the view tasks table for the user to see. This would of course need to be stored as an object in the task's individual state AFTER the user submits a task.. so this would be done in an API call or something similar.. Anyway here's what I was thinking, more could be added later that I'm not thinking of right now:

task = {
  id: '1',
  sku: 'AC7033-101',
  profile: {/*profiles here..*/},
  sizes: '8.5',
  pairs: '1',
  sites: [ // these are populated based on some sort of data gathering on our end..
     {"name": "kith", "url":"https://kith.com", "sitekey": "<captcha sitekey here>", ... },
     {"name": "blends", "url":"https://blendsus.com", "sitekey": "<captcha sitekey here>", ... }
     {"name": "DSM NY", "url":"https://eflash-us.doverstreetmarket.com", "sitekey": "<captcha sitekey here>", ... }
  ],
  status: 'idle',
  errors: {
    sku: null,
    profile: null,
    sizes: null,
    pairs: null,
    sites: null
    status: null,
  },
}

This wraps up option 1, and honestly gets my vote if you ask me.


Option 2.

We keep the current design, but only serve the information to the user when they start the tasks. This would build the task log similarly as before, but the only downside here is the user doesn't know what is supported (if anything) before they ever start the task. The logical flow would work the same as option 1 though, just called at a later point in time.

pr1sm commented 6 years ago

I think option 1 seems better in the long run too. If we go with option 1, there is an implied feature we have to tackle -- how to "remotely" trigger actions within redux. This is because the source of supported sites will have to "remotely" trigger an action to update the site list in the following cases

  1. Filling in the initial supported sites
  2. Adding a supported site after the action is created (we add support for a site)
  3. Removing a supported site after the action is created (we drop support for a site)

A couple of ways to deal with this are opening websockets, or polling for information. After doing some research, I think that websockets are a more stable, responsive way of receiving data from requests, but I think polling for information is easier to start with.

Because of this, we should think of an independent way of making a connection, then receiving events from the connection to trigger redux actions. This way, the redux side of things doesn't need to know if it's using websockets or polling; it simply knows how to [re]start/stop a connection and handle messages received from the connection, transforming them into redux actions. We can then start with a polling solution, then create a websocket solutin and drop it in without having to modify the redux side of things at all.

walmat commented 6 years ago

I'll look into web sockets tonight and see what I can learn! Thanks for the tips and the response 🎉

pr1sm commented 6 years ago

👍 websockets do require a server capable of handling those requests. That would mean it has to be supported by which ever module is providing the listing of supported sites. Meanwhile, polling for information would only require having a timer and sending http(s) requests, something with far more support.

walmat commented 6 years ago

Okay, I'll look into polling for tonight actually! Just reread that and missed when you said that polling would be easier to start with. Oops!

walmat commented 6 years ago

Update: have been working on a pretty extensive list of shopify sites for us to support.. Somehow we'll need to do some data gathering when looking for the captcha to gather the recaptcha sitekey.

Here's the list:

https://12amrun.com
https://a-ma-maniere.com
https://alifenewyork.com
https://atmosny.com
https://beatniconline.com
https://biancachandon.com
https://blendsus.com
https://burnrubbersneakers.com
https://www.ca.ateaze.com
https://ca.octobersveryown.com
https://centre214.com
https://cncpts.com
https://concrete.nl
https://creme321.com
https://doomsday-store.com
https://epitomeatl.com
https://freshragsfl.com
https://justdon.com
https://kith.com
https://lessoneseven.com
https://noirfonce.eu
https://nomadshop.net
https://nrml.ca
https://offthehook.ca
https://packershoes.com
https://properlbc.com
https://renarts.com
https://revengexstorm.com
https://rise45.com
https://rockcitykicks.com
https://rsvpgallery.com
https://shoegallerymiami.com
https://shop.bdgastore.com
https://shop.exclucitylife.com
https://shop.extrabutterny.com
https://shop.havenshop.ca
https://shop.justintimberlake.com
https://shop.travisscott.com
https://shop.undefeated.com
https://shopnicekicks.com
https://sneakerjunkiesusa.com
https://sneakerpolitics.com
https://stay-rooted.com
https://store.unionlosangeles.com
https://thesportsedit.com
https://txdxe.com
https://wishatl.com
https://www.abovethecloudsstore.com
https://www.addictmiami.com
https://amongstfew.com
https://apbstore.com
https://bbbranded.com
https://bbcicecream.com
https://www.blkmkt.us
https://bowsandarrowsberkeley.com
https://capsuletoronto.com
https://cityblueshop.com
https://courtsidesneakers.com
https://deadstock.ca
https://dope-factory.com
https://featuresneakerboutique.com
https://ficegallery.com
https://footzonenyc.com
https://goodasgold.co.nz
https://hanon-shop.com
https://highsandlows.net.au
https://hombreamsterdam.com
https://huntinglodge.no
https://incu.com
https://k101store.com
https://kongonline.co.uk
https://lapstoneandhammer.com
https://leaders1354.com
https://letusprosper.com
https://likelihood.us
https://machusonline.com
https://manorphx.com
https://marathonsports.com
https://minishopmadrid.com
https://www.notre-shop.com
https://oipolloi.com
https://www.oneness287.com
https://www.pampamlondon.com
https://www.philipbrownemenswear.co.uk
https://rimenyc.com
https://www.rooneyshop.com
https://saintalfred.com
https://sneakerworldshop.com
https://socialstatuspgh.com
https://solefly.com
https://soleheaven.com
https://solestop.com
https://stampd.com
https://thechimpstore.com
https://theclosetinc.com
https://thedarksideinitiative.com
https://thesurestore.com
https://unknwn.com
https://urbanindustry.co.uk
https://www.us.ateaze.com
http://www.usgstore.com.au
https://westnyc.com
https://worldofhombre.com
https://xhibition.co

at least with this, it'll give us a place to start.

pr1sm commented 6 years ago

This might go along with our earlier talk about breaking the API up into two sections: one hosted by us that handles general requests, and one hosted by the user (locally or on a server) that handles task related requests.

This would go in the general requests api

walmat commented 6 years ago

This might go along with our earlier talk about breaking the API up into two sections: one hosted by us that handles general requests, and one hosted by the user (locally or on a server) that handles task related requests. ...

@pr1sm very true! You’re right

Sent with GitHawk

pr1sm commented 6 years ago

This relates to #64 -- adding this comment to link the two

walmat commented 6 years ago

I think we can actually close this issue? I think all of the information has been addressed in other issues.

And since we've redone the create task method the original issue is irrelevant