Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR Action thread.exportAsPdf caused an error: ReferenceError: URL is not defined #456

Open
hbosnjak opened this issue Dec 19, 2024 · 1 comment
Labels

Comments

@hbosnjak
Copy link

Describe the bug

The bug comes up in fetching the avatar for generating the html which also is passed to pdf generation.

To Reproduce

use a thread in gmail which dont has a gmail account or an avatar.

Steps to reproduce the behavior:

unction run() { const config = { "description": "Logs data to a Google Spreadsheet and saves emails and attachments.", "settings": { "markProcessedMethod": "mark-read", "logSheetLocation": "/RA_COUCK_MAIL/logsheet-${date.now:date::yyyy-MM}", "logSheetTracing": true, "logFields": [ "log.timestamp", "log.level", "log.location", "log.message", "object.id", "object.date", "object.subject", "object.from", "object.url", "attachment.name", "attachment.size", "attachment.contentType", "stored.location", "stored.url", "stored.downloadUrl", "context.type" ] }, "global": { "thread": { "match": { "query": "-in:trash -in:drafts -in:spam" } } }, "threads": [ { "match": { "query": "from:[email protected]" }, "actions": [ { "name": "global.sheetLog", "args": { "level": "info", "message": "Thread log (pre-main): ${thread.id}" }, "processingStage": "pre-main" }, { "name": "thread.exportAsPdf", // Add PDF export for thread "args": { "location": "/RA_COUCK_MAIL/thread-${thread.id}-${thread.firstMessageSubject}.pdf", "conflictStrategy": "keep" } }, { "name": "global.sheetLog", "args": { "level": "info", "message": "Thread log (main): ${thread.id}" }, "processingStage": "main" }, { "name": "global.sheetLog", "args": { "level": "info", "message": "Thread log (post-main): ${thread.id}" }, "processingStage": "post-main" } ], "messages": [ { "actions": [ { "name": "global.sheetLog", "args": { "level": "warn", "message": "Message log (pre-main): ${message.id}" }, "processingStage": "pre-main" }, { "name": "message.exportAsPdf", // Add PDF export for message "args": { "location": "/RA_COUCK_MAIL/message-${message.id}-${message.subject}.pdf", "conflictStrategy": "keep" } }, { "name": "global.sheetLog", "args": { "level": "warn", "message": "Message log (main): ${message.id}" }, "processingStage": "main" }, { "name": "global.sheetLog", "args": { "level": "warn", "message": "Message log (post-main): ${message.id}" }, "processingStage": "post-main" } ], "attachments": [ { "actions": [ { "name": "attachment.store", "args": { "conflictStrategy": "keep", "location": "/RA_COUCK_MAIL/Attachments/message-${message.id}-${message.subject}-${attachment.name}" } }, ] } ] } ] } ] } return GmailProcessorLib.run(config, "safe-mode") }

Expected behavior

The data should be loged in the sheet and in the Attachment folder the PDF of the threads and meassages has to be stored.

Logs / Screenshots

image
Bildschirmfoto vom 2024-12-19 19-52-59

If applicable, add logs or screenshots to help explain your problem.

Additional context

Affected version of gmail-processor: 30

Add any other context about the problem here.
is the avatar gethering function when th html is generated

@hbosnjak hbosnjak added the bug label Dec 19, 2024
@ahochsteger
Copy link
Owner

@hbosnjak thanks for filing this issue!
Can you give me the full Processing Trace Log that is cut off in the first screenshot?
In addition it would be great to know if this also happens with the most current version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants