Skip to content

Add service newsblur - #183

Open
Simx72 wants to merge 20 commits into
FluentFlame:masterfrom
Simx72:add-service-newsblur
Open

Add service newsblur#183
Simx72 wants to merge 20 commits into
FluentFlame:masterfrom
Simx72:add-service-newsblur

Conversation

@Simx72

@Simx72 Simx72 commented Jul 31, 2026

Copy link
Copy Markdown

Hello, this is my pull request to add the service Newsblur to the Fluentflame project.

I have added the files newsblur.ts and test_newsblur.ts.

For the implementation, I have copied other implementations from the folder services/ and adapted them to Newsblur.

For the development, I used:

There is some stuff that I still don't understand about Redux and Fluentflame Reader, like when to use dispatch and what should it return, or where are RSSSources and RSSItem stored.

However, I am pretty shure that the authenticate(), updateSources(), syncItems() and markAllRead() are implemented correctly.

I stay available for changes, concerns, etc. I'd really like to learn how it's implemented in its entirety.

@Simx72

Simx72 commented Jul 31, 2026

Copy link
Copy Markdown
Author

Oh, and I was signing with the wrong key. My bad

@CrystalSplitter

Copy link
Copy Markdown
Collaborator

I haven't forgotten about this, but there's a lot to go over here (and indeed, we should squash much of this). BUT I appreciate the effort, and I'll go through everything detailed soon-ish.

@CrystalSplitter
CrystalSplitter self-requested a review August 6, 2026 00:45

@CrystalSplitter CrystalSplitter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is good work! I think we can work with this, actually.

There's a bunch of style issues, but I do not consider these a blocker and I can clean them up myself, as it's no hassle for me.

I've left minor comments, but overall my only question here is the large amount of commented out tests and todos.

I'm not quite ready to approve, but I think we're close.

Comment thread .zed/settings.json
@@ -0,0 +1,9 @@
{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We shouldn't add this to the main git repo. Also, do make sure you format all files you do touch!

global.console.error = mocks.consoleError;
});

/*

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What's this for? Did you mean to leave this in?


const feeds: Record<string, NewsblurFeed> | undefined = response.feeds;

if (feeds === undefined) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Prefer if (feeds == null) as I imagine if response.feeds is in fact null, our response is the same. Update the error message below accordingly.

throw APIError("property 'feeds' is undefined");
}

const sources: RSSSource[] = [];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Prefer functional style:

const sources = Object.entries(feeds).map(([_k, v]) => new RSSSource(v.feed_address, v.feed_title));

// minTime to avoid overwhelming the server
configs._lastRefresh = new Date();
// correct?
return json.authenticated === true;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why not return json.authenticated?

// correct?
return json.authenticated === true;
} catch {
return false;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Log the error somewhere so it's not silently omitted?

const url = new URL(configs.endpoint + path);
// set headers
const headers = new Headers();
headers.set("Content-Type", "application/x-www-form-urlencoded");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Huh, interesting. This is fine, but why?

params: ParamsObject,
) {
// set url
while (path.startsWith("/")) path = path.substring(1); // remove leading slash

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: Why? We control the path for all callers.

@@ -0,0 +1,422 @@
import { ServiceConfigs, SyncService } from "../../../schema-types";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you put a comment at the top of this indicating that this is still a work in progress?

@CrystalSplitter

Copy link
Copy Markdown
Collaborator

Also can you squash/rebase your commits into three commits:

  1. Any deps changes, e.g. "pnpm" changes
  2. The actual service
  3. The tests

Use

git rebase -i origin/master

and then mark the commits as s accordingly to squash (or f for fixup).

@Simx72

Simx72 commented Aug 7, 2026

Copy link
Copy Markdown
Author

Wow. Thank you so much for taking the time to review it. I sort of lost my "nord" coding this, but now I really know what to do. I'll take the time to answer each question... eventually (I think I can do it on my phone with the GitHub app, so soon late-ish, it will take more time than expected).

Also, I didn't know the commits could be rebased, I thought once it was committed, you couldn't change it anymore. I'll make a more proper pull request next time.

Once again, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants