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

adding omnivore saveurl integration #2237

Merged
merged 3 commits into from
Dec 5, 2023

Conversation

jhjaggars
Copy link
Contributor

Do you follow the guidelines?

This PR introduces a "save" integration for Omnivore. In order to use it you must generate an API key and input it into the integration section of the settings.

This PR depends on the google/uuid package (which is already an indirect dependency).

@fguillot
Copy link
Member

fguillot commented Dec 2, 2023

--- FAIL: TestMissingTranslations (0.01s)
    catalog_test.go:86: Translation key "form.integration.omnivore_api_key" not found in language "de_DE"

https://miniflux.app/docs/i18n.html#update-translations

@jhjaggars jhjaggars force-pushed the omnivore-integration branch 4 times, most recently from b0e8269 to f703b6e Compare December 3, 2023 17:04
@fguillot fguillot linked an issue Dec 3, 2023 that may be closed by this pull request
internal/template/templates/views/integrations.html Outdated Show resolved Hide resolved
return err
}

_, err = c.wrapped.Do(req)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no error shown in the logs if the API key or the API URL is incorrect. It should at least check the response given by Omnivore API.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've addressed this by following the pattern in the pocket integration (returning an error for http response codes >=400). The response body is logged as well which might be helpful, but I was unsure if the risk of dumping a ton of text into the log is worth it. Let me know if you'd like to limit or completely omit this part.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When testing, Omnivore seems to return a JSON response like this regardless of the error:

error="omnivore: failed to save URL: status=500 {\"errors\":[{\"message\":\"Unexpected server error\"}]}\n"

It would be nice to parse the JSON response, and log only the error message. It could be done in another pull-request.

internal/integration/omnivore/omnivore.go Outdated Show resolved Hide resolved
@jhjaggars jhjaggars force-pushed the omnivore-integration branch from f703b6e to d1159f6 Compare December 4, 2023 01:37
@jhjaggars jhjaggars force-pushed the omnivore-integration branch from d1159f6 to 707f777 Compare December 4, 2023 01:40
@fguillot fguillot merged commit e933fb1 into miniflux:main Dec 5, 2023
15 checks passed
@emdoe emdoe mentioned this pull request Mar 8, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add Omnivore integration
2 participants