Commit Graph

64 Commits

Author SHA1 Message Date
b98f7c6ba2 reject with unknow reason if failed to send confirmation email 2022-07-25 15:12:55 -07:00
1ea34bde62 send confirmation email to pending user 2022-07-25 15:12:55 -07:00
ba73eec9e5 create pending user first 2022-07-25 15:12:55 -07:00
0bcb8a23c5 Use new API methods for saving 2022-07-16 12:17:58 -07:00
3136705a75 Handle errors when creating a page save request on savePage 2022-06-09 13:52:49 -07:00
85cbd4e9d0 Handle errors updating elastic when saving pages 2022-06-09 13:52:49 -07:00
eef3ee4114 Add getLabelsByIds service method 2022-06-08 14:59:27 +08:00
0cabd26344 Dont send the normalized URL to the content-fetch service
URLs need to be sent to contentFetch exactly as they
were received, this is because many apps will use signed URLs
for PDFs being served from GCP or AWS. A signed URL needs to
keep all its query params in the same order to validate.
2022-05-26 21:40:40 -07:00
93b095818d Linting fixes 2022-05-26 21:40:40 -07:00
a20ba60053 Add popular reads for onboarding 2022-05-24 15:31:55 -07:00
ea50f51644 Update to use image proxy URLs in parsed content 2022-05-24 13:43:57 -07:00
ed5dfde1a8 Linting fixes, remove debug 2022-05-24 13:06:40 -07:00
2b14d51ec6 API to add recommended (popular) reads to a users library
This API is used in onboarding
2022-05-24 12:05:39 -07:00
2d2495a10e Merge pull request #685 from omnivore-app/fix/pdf-api-simplification
Simplify the API to create pages from PDFs
2022-05-21 21:19:30 -07:00
e5bc68ca9e Simplify the API to create pages from PDFs
This creates a stub page when an upload is initiated, so the
SaveFile (or create article from file) APIs do not need to be
called.

The PDF uploaded trigger fired by GCS will mark the upload
as completed and update the page status.
2022-05-21 12:05:45 -07:00
17e6f4091d Merge pull request #638 from omnivore-app/feature/subscription-api
Feature/subscription api
2022-05-20 15:34:48 -07:00
444c21ad09 Fix labels test 2022-05-19 18:12:14 +08:00
d9d4deb14c Update Money Stuff sign up url 2022-05-18 11:50:43 +08:00
5b36f9270e Update milk road query params 2022-05-17 22:43:00 +08:00
13453e7b7f Register subscribe resolver 2022-05-17 21:26:46 +08:00
568472cc3c Calling HTTP requests to subscribe to these newsletters 2022-05-17 21:15:25 +08:00
1da8b75c81 Add a subscribeHandler 2022-05-17 18:46:44 +08:00
45213e7b54 Fix reminder trigger 2022-05-13 17:07:10 +08:00
adfaf6b8ce Use newsletter's title and author as page's ones 2022-05-12 18:08:38 +08:00
7c6b810522 Remove redundant JSDOM 2022-05-06 10:53:36 +08:00
9e3db0e053 Fix a bug to have multiple pages with the same url in lib 2022-05-04 19:12:22 +08:00
afe8b6e948 make savedAt a required field in page 2022-05-04 17:54:59 +08:00
9048ccbab3 Show failed pages in library 2022-05-04 12:46:57 +08:00
80d0146f72 Show unable to parse if page is failed to save within 30 seconds 2022-05-04 11:55:16 +08:00
2b70d480d2 Remove article saving request (#493)
* Add state and taskName in elastic page mappings

* Add state and taskName in elastic page interface

* Create page with PROCESSING state before scrapping

* Update createArticleRequest API

* Fix tests

* Add default state for pages

* Update createArticle API

* Update save page

* Update save file

* Update saving item description

* Show unable to parse content for failed page

* Fix date parsing

* Search for not failed pages

* Fix tests

* Add test for saveUrl

* Update get article saving request api

* Update get article test

* Add test for articleSavingRequest API

* Add test for failure

* Return new page id if clientRequestId empty

* Update clientRequestId in savePage

* Update clientRequestId in saveFile

* Replace article with slug in articleSavingRequest

* Add slug in articleSavingRequest response

* Depreciate article

* Use slug in web

* Remove article and highlight fragments

* Query article.slug on Prod

* Show unable to parse description for failed page

* Fix a bug having duplicate pages when saving the same url multiple times

* Add state in response

* Rename variables in removeArticle API

* Rename state

* Add state in response in web

* Make state an enum

* Open temporary page by link id

* Use an empty reader view as the background for loading pages

* Progressively load the article page as content is loaded

* Add includePending flag in getArticles API

* Set includePending = true in web

* Add elastic update mappings in migration script

* Add elastic mappings in docker image

* Move index_settings.json to migrate package

* Remove elastic index creation in api

* Move elastic migrations to a separate directory

* Remove index_settings from api docker image

Co-authored-by: Jackson Harper <jacksonh@gmail.com>
2022-04-29 13:41:06 +08:00
ccb79845bc Fix subscriptions issues (#501)
* Replace fetch with axios

* Add url in subscription

* Remove url in subscription

* Unsubscribe all newsletters before deleting that email

* Continue unsubscribing others if one got error
2022-04-29 11:16:46 +08:00
dca6461b62 Add unsubscribe resolver (#453)
* add unsubscribe resolver

* add subscription to articles api response

* revert yarn.lock changes
2022-04-21 13:18:15 +08:00
5c7f4a22bf Save subscriptions when saving newsletters (#447)
* parse unsub mailTo or httpUrl and send to pubsub

* save subscription from newsletter

* fix tests
2022-04-20 09:24:40 +08:00
ae0d1dd2ee Feature/search highlights backend (#395)
* add highlight mappings

* return highlight in resolvers

* temporarily skip highlight tests

* add test for getting highlights

* update merge highlight

* separate elastic methods

* roll back merge highlight test

* add highlight to elastic script

* update delete highlight in elastic

* migrate highlight data from postgres to elastic

* rescue not found exception when page is not found in the migration script

* exclude highlights in searching pages results

* search pages with highlights only with has:highlight query

* add search endpoint to search pages or highlights

* reduce code smell in search api

* fix rebase error

* fix tests

* add test for search highlight

* add test for new search endpoint

* add labels to search results

* update schema

* update search query

* fix update/share highlights

* fix rebase error

* fix tests

* add highlight model in elastic

* add savedAt and publishedAt date range in search query

* add sort by updated and recently read

* fix tests

* close db connection when tests are done

* test github action

* revert github action test

* fix rebase error

* add docker-compose for api-test

* remove unused env

* remove highlights with no page attached to

* allow get_articles resolver to search for query so we can merge it without web changes
2022-04-12 12:31:08 +08:00
d1269f815e identify a newsletter by checking both list-url and unsubscribe-url in headers and email sender address 2022-04-06 20:59:14 +08:00
7569e988bf upgrade typeorm to 3.0 (#359)
* upgrade typeorm to 3.0

* use new datasource object in typeorm 3

* fix tests

* fix tests

* migrate before creating connection

* fail the test if migration failed
2022-04-06 10:32:41 +08:00
9845a49040 Remove semicolon 2022-04-04 08:17:46 -07:00
c8ec7d636e Use require to import address parser function 2022-04-04 08:11:26 -07:00
da28998130 Pull ul list out of newsletter blurb
next/react doesnt want child elements of the paragraphs

Improve formatting

Improve wording

Use buttons in the subscribe directly blocks

Simplify docs on setting up forwarding rules

Add extra padding on bottom of help docs

Remove unused style

Add emails help page

Improve formatting

Prefetch page content on iOS

Reduce the reader overly length now that items are precached

Add invalidation when highlights are added to items

fix missing index_settings.json file in api dockerfile for creating elastic index (#363)

Handle full email address objects in the to param from sendgrid

These come in a format like:

"jacksonh-dfdf@inbox.omnivore.app" <jacksonh-dfdf@inbox-demo.omnivore.app>

New IDs for short highlights because they dont cascade delete now

Testing CI issues

Simplify test

CI test

Use promises for async tests

Temporarily remove test to debug CI

Re-enable

re-enable test, return error

Specify a userId when looking up saved email pages

create a unique url for newsletters without a URL

Use 500ms on page test timeouts

Increase timeout

Dont use deep equal to match newsletter label

Run just the labels API

Run against just the newsletter emails

Run without the page tests

Fix

Set the allow uncaught flag

Remove highlight tests

Remove newsletters tests

more resolver tests

Remove newsetter tests

Comment out resolver tests

Use nock for external requests in tests

Specify puppeteer url for tests

Comment out more tests

uncomment tests

re-enable

re-enable email test

Re-disable

Re-enable one pdf attachment test

Re-disable pdf attachment test

Use promises on setTimeout tests

rm label tests

mv label tests into a context

Comment out pdf tests

Comment out pdf tests

Async test

Async wrappers

Delay when creating test pages

More debugging

Unique short ids

Remove potentially problematic test

Fetch page before returning for test

handler in before block

more debugging

More debugging

Move errors checks into contexts

Use a context when saving newsletters to force index refresh

Prettier fix

Fix newsletter label check, remove setTimeout

Re-enable test

timeout on pdf router handler

Fix method call

comment out PDF test

Unique fake username

Comment out PDF test

Debugging signed urls

Re-enable

New email

pdf test

PDF tests

Comment out pdf test

Add nock stubs for email URLs

Use full address for PDF test

Remove debug

Use full email addresses
2022-04-02 16:56:24 -07:00
2bada0b9df Merge pull request #293 from omnivore-app/feature/priority-by-rate-limit
Use lower priority queue for large imports
2022-03-28 13:19:35 -07:00
b6c04f3508 fix saving report item by linking to elastic page 2022-03-28 20:38:54 +08:00
6597cc37b6 add created_at and updated_at to newsletter emails and sort by created_at desc 2022-03-22 18:43:47 +08:00
acec3b1acb Use lower priority queue for large imports
* add a count query in elastic
  * if priority is not set, check the rate limit of user's libary
    - if 5 articles added in the last minute: use low queue
    - default: use normal queue
2022-03-22 18:08:08 +08:00
af037a2837 make readingProgress required in the elastic page data (#253)
* make readingProgress required in the elastic page data

* delete readingProgress from function_resolvers because we have stored them in elastic
2022-03-17 10:06:21 +08:00
07dcd5da26 add label to page only if not exists 2022-03-16 23:00:37 +08:00
f412758040 add Newsletter label to the page created by newsletters email 2022-03-16 18:40:05 +08:00
e652a6ea8c Rebased version of the elastic PR (#225)
* Add elastic to our docker compose

* add AND/OR/NOT search operations

* add elastic and create article in elastic

* change error code when elastic throws error

* add search pages in elastic

* add search by labels

* Add elastic to GitHub Action

* Update elastic version

* Fix port for elastic

* add url in search query

* Set elastic features when running tests

* add debug logs

* Use localhost instead of service hostname

* refresh elastic after create/update

* update search labels query

* add typescript support

* search pages in elastic

* fix search queries

* use elastic for saving page

* fix test failure

* update getArticle api to use elastic

* use generic get page function

* add elastic migration python script

* fix bulk helper param

* save elastic page id in article_saving_request instead of postgres article_id

* fix page archiving and deleting

* add tests for deleteArticle

* remove custom date type in elastic mappings which not exist in older version of elastic

* fix timestamp format issue

* add tests for save reading progress

* add tests for save file

* optimize search results

* add alias to index

* update migration script to receive env var as params

* Add failing test to validate we don't decrease reading progress

This test is failing with Elastic because we aren't fetching
the reading progress from elastic here, and are fetching it
from postgres.

* Rename readingProgress to readingProgressPercent

This is the name stored in elastic, so fixes issues pulling the
value out.

* Linting

* Add failing test for creating highlights w/elastic

This test fails because the highlight can't be looked up. Is there
a different ID we should be passing in to query for highlights,
or do we need to update the query to look for elastic_id?

* add tests code coverage threshold

* update nyc config

* include more files in test coverage

* change alias name

* update updateContent to update pages in elastic

* remove debug log

* fix createhighlight test

* search pages by alias in elastic

* update set labels and delete labels in elastic

* migration script enumeration

* make BULK_SIZE an env var

* fix pdf search indexing

* debug github action exit issue

* call pubsub when create/update/delete page in elastic

* fix json parsing bug and reduce reading data from file

* replace a depreciated pubsub api call

* debug github action exit issue

* debug github action exit issue

* add handler to upload elastic page data to GCS

* fix tests

* Use http_auth instead of basic_auth

* add index creation and existing postgres tables update in migration script

* fix a typo to connect to elastic

* rename readingProgress to readingProgressPercent

* migrate elastic_page_id in highlights and article_saving_request tables

* update migration script to include number of updated rows

* update db migration query

* read index mappings from file

* fix upload pages to gcs

* fix tests failure due to pageContext

* fix upload file id not exist error

* Handle savedAt & isArchived attributes w/out quering elastic

* Fix prettier issues

* fix content-type mismatching

* revert pageId to linkId because frontend was not deployed yet

* fix newsletters and attachment not saved in elastic

* put linkId in article for setting labels

* exclude orginalHtml in the result of searching to improve performace

* exclude content in the result of searching to improve performace

* remove score sorting

* do not refresh immediately to reduce searching and indexing time

* do not replace the backup data in gcs

* fix no article id defined in articleSavingRequest

* add logging of elastic api running time

* reduce home feed pagination size to 15

* reduce home feed pagination size to 10

* stop revalidating first page

* do not use a separate api to fetch reading progress

* Remove unused comment

* get reading progress if not exists

* replace ngram tokenizer with standard tokenizer

* fix tests

* remove .env.local

* add sort keyword in searching to sort by score

Co-authored-by: Hongbo Wu <hongbo@omnivore.app>
2022-03-16 12:08:59 +08:00
bea7d084c4 SetClaims when creating an email article 2022-03-09 19:45:52 -08:00
384a0771a7 Merge pull request #200 from omnivore-app/fix/validate-urls
Use the validateUrl method to validate URLs
2022-03-08 20:28:33 -08:00
c45c408c14 Fix formatting 2022-03-08 15:27:05 -08:00