nextcloud / social

🎉 Social can be used for work, or to connect to the fediverse!
https://apps.nextcloud.com/apps/social
GNU Affero General Public License v3.0
490 stars 59 forks source link

Update account.js #1738

Closed srijansaxena11 closed 1 year ago

srijansaxena11 commented 1 year ago

The method _getActorIdForAccount was not returning the value. Return statement added. Also the state.accountIdMap contains local accounts as username@localhost. But the account passed to it was username@nextcloud.domain even in case of local accounts. The same has been handled by checking the hostname of account to the current hostname. Should work fine for local account.

Summary

Compiled and verified. Profile is now opening: image

srijansaxena11 commented 1 year ago

Can anyone please review and merge this PR and discuss about other issues? @ArtificialOwl @artonge

ArtificialOwl commented 1 year ago

@artonge ?

artonge commented 1 year ago

Hello @srijansaxena11, I think the issue is more with your config than with the code.

Can you check the value of overwrite.cli.url in your config.php? It should be the same as the domain you are using to use your Nextcloud server.

artonge commented 1 year ago

You will probably have to use the occ social:reset change the domain name the Social is using.

srijansaxena11 commented 1 year ago

Hello @srijansaxena11, I think the issue is more with your config than with the code.

Can you check the value of overwrite.cli.url in your config.php? It should be the same as the domain you are using to use your Nextcloud server.

overwrite.cli.url is my domain name only.

You will probably have to use the occ social:reset change the domain name the Social is using.

occ social:check:install also shows the cloud_url as my domain name only. I already did the social:reset as my first step to debug the issue.

srijansaxena11 commented 1 year ago

Do I need to check somewhere in any of the tables in database?

srijansaxena11 commented 1 year ago

@artonge Do you have it working somewhere where I can join and test? I will be more than happy to identify the issue. Also the follow feature is not working. I am also trying to identify the issue there.

artonge commented 1 year ago

I do not have a publicly available setup.

Just to be sure that I understand the issue, state.accountIdMap contains an entry for localUserId@localhost, which should be localUserId@domain.tld.

The front end is using the host part of the URL to fill the missing host part for local users.

But this is for local accounts, what is the issue with remote ones?

srijansaxena11 commented 1 year ago

Just to be sure that I understand the issue, state.accountIdMap contains an entry for localUserId@localhost, which should be localUserId@domain.tld.

Correct. Or vice-versa.

But this is for local accounts, what is the issue with remote ones?

The very first description of this thread which I wrote. The _getActorIdForAccount method is not returning any value. Adding the return statement to it fixes the issue with remote accounts.

artonge commented 1 year ago

Correct. Or vice-versa.

What do you mean?

The very first description of this thread which I wrote. The _getActorIdForAccount method is not returning any value. Adding the return statement to it fixes the issue with remote accounts.

The original code does return a value, there is no need for a return statement for arrow functions.

srijansaxena11 commented 1 year ago

What do you mean?

like the account to be searched and the account in accountIdMap should both have either @domain.com or @ localhost.

The original code does return a value, there is no need for a return statement for arrow functions.

Not sure about that but adding the return statement resolves it and removing it brings it back. I set up my local nextcloud social setup to verify these small things.

srijansaxena11 commented 1 year ago

The accountInfo() from accountMixins.js points to undefined value without the return statement in _getActorIdForAccount in account.js

ArtificialOwl commented 1 year ago

@artonge Do you have it working somewhere where I can join and test? I will be more than happy to identify the issue. Also the follow feature is not working. I am also trying to identify the issue there.

Send me a mail to maxence@nextcloud.com i'll generate an account on our testing installation. Can you also send me your social account also so I can check your setup from outside ?

srijansaxena11 commented 1 year ago

Send me a mail to maxence@nextcloud.com i'll generate an account on our testing installation.

Sure. What am I supposed to mention?

Can you also send me your social account also so I can check your setup from outside ?

My social is @srijan@cloud.srijan.site. See if it is found from outside. Another issue is I am unable to follow any user (local or global). It might be related to webfinger as someone else pointed out in another issue thread. But doing the suggested changes didn't resolve that. The changes were the response of webfinger was missing acct: in subject whereas the response of mastadon and friendica had it in subject. But that didn't help too.

srijansaxena11 commented 1 year ago

Send me a mail to maxence@nextcloud.com i'll generate an account on our testing installation.

I have dropped the mail.

srijansaxena11 commented 1 year ago

The testing environment is working perfectly fine. Not really sure what is the issue with my setup. Can it be a different PHP version or something. @ArtificialOwl can you please share the following details as mine:

Nextcloud Version: 26.0.1 RC1 Social Version: 0.6.0-rc2 PHP Version: 8.1.2

Not sure if anything else can make a difference.

srijansaxena11 commented 1 year ago

Hi @ArtificialOwl @artonge I made progress. I can be followed now from other accounts (Social, Mastodon, etc.) but I cannot follow any account. I get the following error: image

Any suggestions to debug this?

srijansaxena11 commented 1 year ago

Everything is working now.