Commit Graph

55 Commits

Author SHA1 Message Date
4eba7df84c always upsert library items 2024-02-06 16:53:32 +08:00
d5d581fc54 remove redundant logs 2024-01-29 14:32:43 +08:00
4c765378e3 do not retry if find_thumbnail job fails 2024-01-26 13:01:53 +08:00
5e239d2568 run readability in save-page instead of puppeteer 2024-01-25 16:30:59 +08:00
b86ee139e0 move to folder api will create a task to fetch content if content not exists 2023-12-14 19:20:03 +08:00
83e0982457 save newsletters to the right folder get from subscription and email settings 2023-12-14 18:53:32 +08:00
dcd6e8bb60 allow adding source of label when adding labels 2023-12-13 16:25:25 +08:00
36777568ac create/add RSS labels to the library item when feedUrl is there 2023-12-08 11:29:03 +08:00
3b8b48bc21 fix recovered deleted items still shown in trash 2023-10-05 14:31:07 +08:00
b9af543b45 fix rss feeds 2023-10-05 14:31:06 +08:00
4ff5484d8e change item_type to text 2023-10-05 14:31:06 +08:00
fdd771bc06 add migration script 2023-10-05 14:31:06 +08:00
cbaa3d6900 fix newsletters test 2023-10-05 14:30:10 +08:00
c3caf15e44 fix auth tests 2023-10-05 14:30:10 +08:00
b72acf8e6f fix permission issue 2023-10-05 14:28:52 +08:00
c1ad9b6f41 cont 2023-10-05 14:27:18 +08:00
06000264d2 replace saveEmail 2023-10-05 14:22:58 +08:00
fc52b522f2 fix test 2023-10-05 14:22:58 +08:00
163dbc73a6 do not send content in the thumbnail task payload 2023-08-10 11:55:59 +08:00
99a52f8d56 replace all the console logs with logger logs 2023-07-27 16:06:44 +08:00
07d43812a7 use winston logger instead of console log so the log will be truncated if it exceeds the max entry size 2023-07-26 16:27:18 +08:00
7c0c4eaa40 fix: type error 2023-06-27 21:05:00 +08:00
ed8287df19 remove tracking params from tweet url 2023-06-27 17:49:31 +08:00
9be84fb473 create thumbnail task for newsletters too 2023-06-07 11:52:13 +08:00
2c39916441 Add wordsCount to article schema 2023-01-02 16:49:11 +08:00
7c39db207b Replace createArticle with savePage in puppeteer-parse service 2022-12-28 10:15:05 +08:00
66d37e31b1 Use siteIcon 2022-09-27 21:41:01 +08:00
fa731acd74 Create new newsletter if old one is deleted 2022-09-14 19:14:58 +08:00
6d19c8c9bc Remove unused import 2022-07-28 11:43:16 -07:00
1525742b4e Linting fixes 2022-07-28 11:23:27 -07:00
565da42b46 When parsing newsletters with no url dont fetch the generated url 2022-07-28 11:05:17 -07: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
afe8b6e948 make savedAt a required field in page 2022-05-04 17:54:59 +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
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
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
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
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
c45c408c14 Fix formatting 2022-03-08 15:27:05 -08:00
e8fca4a7a9 Remove debug line 2022-03-08 15:20:24 -08:00
26dadab4aa rm debug, we dont need to set claims on create 2022-03-08 15:10:01 -08:00
b982bf34d6 SetClaims on userArticle create/update in saveEmail 2022-03-08 14:43:10 -08:00
9ae81d7394 Add extra debugging on newsletter save errors 2022-03-08 14:00:35 -08:00
05373ba3c7 add methid to parse content metadata 2022-03-03 17:10:06 -08:00
c2e08d0e8f Fetch title and author from page metadate if possible 2022-03-03 15:20:58 -08:00