Commit Graph

38 Commits

Author SHA1 Message Date
c99c1db57e Add support to the case when from address is in Name <address> format 2022-07-28 10:26:15 +08:00
0bdab51bbd Merge pull request #1021 from omnivore-app/feature/save-from-email
Save articles by sending emails to omnivore inbox
2022-07-27 20:10:31 +08:00
87efb85a6e Fix tests, Cont 2022-07-27 13:11:04 +08:00
f286a89a5f Fix tests 2022-07-27 12:32:49 +08:00
dfa0a65d15 Add tests for email forward router 2022-07-27 12:15:28 +08:00
6f11ccacb1 Save article from forwarding emails 2022-07-27 12:15:28 +08:00
c80270ae81 Update expected redirect URLs in tests 2022-07-26 15:58:38 -07:00
8b072ab094 Update expected URLs for tests
- after email is sent the user is redirected to an information page
- after login the user is redirected through the sso page
2022-07-26 15:18:56 -07:00
acd36fe9af Move auth routes into /auth folder 2022-07-26 10:31:45 -07:00
560f95b57e fix test 2022-07-25 15:14:01 -07:00
43d2216983 fix test 2022-07-25 15:14:01 -07:00
024d4bd25c stop referring to user entity before migration 2022-07-25 15:14:01 -07:00
bd77a7f8ee add test for reset password 2022-07-25 15:14:01 -07:00
6699ec834d add router handler for reset password 2022-07-25 15:14:01 -07:00
286d167769 add router handler for email reset password 2022-07-25 15:14:01 -07:00
bab96aaa1e remove membership from user 2022-07-25 15:14:01 -07:00
ea9d98aa95 make confirm-email a post api 2022-07-25 15:14:01 -07:00
a87f75f319 add test for confirm-email router 2022-07-25 15:14:01 -07:00
9ea9bd9ea1 send confirmation email to pending user when login 2022-07-25 15:14:01 -07:00
bd2327a3ae test set auth token after login 2022-07-25 15:14:01 -07:00
abb1a414c1 remove login gql resolver 2022-07-25 15:13:58 -07:00
86b950183c fix test 2022-07-25 15:13:32 -07:00
f7053622a5 remove signup gql resolver 2022-07-25 15:13:30 -07:00
c0f6ed11d5 disable pdf and upload testing temporarily because we do not have a bucket for testing 2022-07-14 19:13:51 +08:00
aae9d7e382 Fix test 2022-06-24 10:13:14 -07:00
9981e506e4 mock webhook request 2022-05-26 15:12:11 +08:00
a75ce3c44d Add get/list/delete webhook resolver 2022-05-26 14:52:00 +08:00
cc07c00a83 Add get/list/delete webhook gql schema 2022-05-26 14:51:11 +08:00
c9c6f83e65 Add tests for trigger endpoint 2022-05-26 14:51:11 +08:00
0b0b521fab use generic method for uploading 2022-04-13 22:21:20 +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
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
1893e36375 Fix uploading endpoint returns 504 (#289)
* add timeout = 60s for uploading to private bucket

* add debug logs

* send response to client to close connection

* add tests for upload

* add PUBSUB_VERIFICATION_TOKEN in .env.test
2022-03-22 14:20:40 +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
d53e94aeb2 add tests for create article 2022-02-16 16:14:14 +08:00
77ba7531f3 add tests for upload 2022-02-16 15:26:11 +08:00
a04e91472d fix a bug of using article as table name in the reminders query (#34)
* fix a bug of using article as table name in the reminders query

* fix test

* increase timeout value

* increase timeout value to 50000

* add import mocha

* add import mocha for label test

* add import mocha for every test

* fix test in deleting labels

* add timeout for each label test

* one more test

* fix reminders router by allowing sendrid template id to be null

* do not retry if reminders not found
2022-02-14 13:59:04 +08:00
84f32935f5 Open source omnivore 2022-02-11 09:24:33 -08:00