Giter VIP home page Giter VIP logo

act-now-links-service's People

Contributors

pnavarrc avatar smcclure17 avatar

Stargazers

 avatar

Watchers

 avatar

act-now-links-service's Issues

Write documentation

Find the best way to document this kind of API and write the documentation (could maybe just go in the README)

Set up production firebase project

Currently we're running everything off of act-now-links-dev. We should create an act-now-links-prod project, and update the production pointers/config in the repo to point at it

Switch from token to service account authorization in Github Actions

Per warning:

Authenticating with `--token` is deprecated and will be removed in a future major version of `firebase-tools`. 
Instead, use a service account key with `GOOGLE_APPLICATION_CREDENTIALS`: 
https://cloud.google.com/docs/authentication/getting-started

token-based auth is deprecated and we should switch to using a service account.

We will need to create a new service account, add that as a repository secret (where the FIREBASE_CI_TOKEN secret currently lives), and update our Github Action workflows to use it instead of the token (presumably with an env variable)

`/getShareLinkUrl` requests being blocked due to (an assumed) CORS issue

Requests to the links service began failing unexpectedly (without any changes as far as I can d) due to a CORS issue.

Requests succeed in CORS testers.

Example of blocked/failed request:
Image

Note the 301: Permenantly Moved response; AFAIK this request shouldn't be making any redirects. It's possible that if the request is being redirected (though I don't think it should be) and the access-control-allow-origin: * header is being lost/not forwarded, resulting in the request being blocked.

use URL param with encoded URLS instead of wildcard

Right now we detect the "url param" using a wildcard at the end of the URL, which avoids encoding issues, but is hacky and prone to issues.

using encode/decodeUriComponent() should allow us to pass URLs into formal URL query parameters, giving us more stability.

e.g. use https://www.api-service?url=<encoded-url as opposed to https://www.api-service/<unencoded-url>

Anecdotally we know it's possible b/c e.g. https://cors-test.codehappy.dev/?url=https%3A%2F%2Fus-central1-act-now-links-dev.cloudfunctions.net%2Fapi%2FgetShareLinkUrl%2Fhttp%3A%2F%2Fhackathon-september-2022-4dve.vercel.app%2F%2F%2Fus%2Farkansas-ar-pope-county&method=get uses this method

Simplify "screenshot ready" logic in act-now-links-service and components / templates.

As discussed at standup, I think we could have two classes that we use in our components that asynchronously load data:

  • act-now-data-loading - used initially before data is loaded / ready.
  • act-now-data-loaded - used after data is rendered and it's safe to take a screenshot.

And the link service could wait until:

  1. At least one instance of act-now-data-loaded exists on the page.
  2. No instances of act-now-data-loading exists on the page.

Then you can just use our components in your share image, and it'll "just work" without any logic / mutation observers, etc...

Make `/registerUrl` requests idempotent

There's a possible race condition where two share links can be created for the same URL if two requests are made near simultaneously. We expect there to only ever be one share link per URL.

Can maybe do this by seeding the "random" hash/share link ID with the url? This will prevent multiple share links from being created, but still has issues. If two requests are sent simultaneously to create a share link for the same URL but otherwise different params, I'm not sure which data will be saved? Will a collision cause undefined behavior?

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.