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

Fix #1828: urlToAccounts returns converted data #1830

Merged
merged 1 commit into from
Aug 13, 2023

Conversation

fasiha
Copy link
Contributor

@fasiha fasiha commented Jul 28, 2023

Looks like the regression happened in fe7c66e#diff-bc08808ad598b8a873b55b7fe24d4bd6b4159f3228b5f4ffc947bf3bbeca0604R572 here, note how we build converted but never return it 😭. The friendica.ts has the correct return, just not Mastodon 😅


Tested as follows (I may have skipped a step here, sorry, let me know and I'll elaborate this): first check out this branch of megalodon and build it via:

npm i --force
npm run build -w megalodon

(There's some weird version issue when run npm i, something about eslint being unsatisfied, so I use --force to skip this…)

Then make a test app and install this modified megalodon:

mkdir megalodon-test
cd megalodon-test
npm init -y
npm i typescript
npx tsc --init
npm i -S /path/to/megalodon

and in here create index.ts:

import generator, { Entity, Response } from "megalodon";
const BASE_URL = "https://octodon.social";
const access_token = "...";
const client = generator("mastodon", BASE_URL, access_token);
client.getAccountFollowers("45008", { get_all: true }).then((res) => {
  console.log(res.data.length);
});

and build this and run it:

npx tsc -p .
node index.js

Should print out a number >40. (45008 is me on Octodon, so you'll have to change this probably.)

Copy link
Owner

@h3poteto h3poteto left a comment

Choose a reason for hiding this comment

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

Thanks!

@h3poteto h3poteto merged commit f32710f into h3poteto:master Aug 13, 2023
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