Skip to content
This repository has been archived by the owner on Jul 31, 2020. It is now read-only.

Support multi-database accounts #4

Open
Stvad opened this issue Mar 7, 2020 · 7 comments
Open

Support multi-database accounts #4

Stvad opened this issue Mar 7, 2020 · 7 comments
Milestone

Comments

@Stvad
Copy link

Stvad commented Mar 7, 2020

See #1 on initial discussion

@Stvad
Copy link
Author

Stvad commented Mar 7, 2020

So I have this snippet to get DB list

const getDatabases =
    async page => await page.$$eval(
        "#app > div:nth-child(1) > div > h4:nth-child(1) > a:nth-child(1)",
        nodes => nodes.map(n => n.innerText))

It works, and the rest of the script seems to as well, but at the end it fails as there is no zip file 🤔. Tried taking a screenshot, but it just shows main page of my db. Any advice @signalnerve

@Stvad
Copy link
Author

Stvad commented Mar 7, 2020

Ok, tried on the other (smaller) DB, it worked, I guess I'll try increasing final timeout even higher...

@Stvad
Copy link
Author

Stvad commented Mar 7, 2020

Yeah, that helped, but need to have timeout like 30 sec

@Stvad
Copy link
Author

Stvad commented Mar 7, 2020

gonna publish a PR for multi-db support tomorrow-ish

Stvad added a commit to Stvad/roam-backup that referenced this issue Mar 7, 2020
Stvad added a commit to Stvad/roam-backup that referenced this issue Mar 7, 2020
@jrykner
Copy link

jrykner commented Mar 8, 2020

I'm getting timeout error at waiting for selector:
{ TimeoutError: waiting for selector ".bp3-popover-wrapper > .bp3-popover-target > div > .bp3-button > .bp3-button-text" failed: timeout 30000ms exceeded
21
at new WaitTask (/home/runner/work/roam-backup/roam-backup/node_modules/puppeteer/lib/DOMWorld.js:549:28)
22
at DOMWorld._waitForSelectorOrXPath (/home/runner/work/roam-backup/roam-backup/node_modules/puppeteer/lib/DOMWorld.js:478:22)
23
at DOMWorld.waitForSelector (/home/runner/work/roam-backup/roam-backup/node_modules/puppeteer/lib/DOMWorld.js:432:17)
24
at Frame.waitForSelector (/home/runner/work/roam-backup/roam-backup/node_modules/puppeteer/lib/FrameManager.js:627:47)
25
at Frame. (/home/runner/work/roam-backup/roam-backup/node_modules/puppeteer/lib/helper.js:112:23)
26
at Page.waitForSelector (/home/runner/work/roam-backup/roam-backup/node_modules/puppeteer/lib/Page.js:1122:29)
27
at downloadDatabase (/home/runner/work/roam-backup/roam-backup/index.js:43:14)
28
at process._tickCallback (internal/process/next_tick.js:68:7) name: 'TimeoutError' }
29
(node:3226) UnhandledPromiseRejectionWarning: Error: Couldn't find a file to upload, aborting

any idea how to solve this??

@Stvad
Copy link
Author

Stvad commented Mar 8, 2020

do you have multiple databases? if so - you can use version from #6

otherwise - you can try increasing the relevant timeout (https://github.com/puppeteer/puppeteer/blob/master/docs/api.md#pagewaitforselectorselector-options)

@jrykner
Copy link

jrykner commented Mar 8, 2020

do you have multiple databases? if so - you can use version from #6

otherwise - you can try increasing the relevant timeout (https://github.com/puppeteer/puppeteer/blob/master/docs/api.md#pagewaitforselectorselector-options)
yes I was using the multiple DB version, I increased the timeout as you suggested and now it works fine, thanks!

hopefully we can get a version that exports to Google Drive

@kristianfreeman kristianfreeman added this to the v1.1 milestone Mar 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants