Skip to content

SocialFollowingManager.StopFollowing is not working #10159

Open
@ishaisagi-hns

Description

@ishaisagi-hns

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • SPFx version 1.20

Describe the bug / error

It worked a couple of months back but now the same code runs (no error) but the user remains followed.
I have tried both using pnp.js "
const unfollowResult = await this.sp.social.stopFollowing(userInfo);
and using direct api access:
const restApiUrl = ${this.context.pageContext.web.absoluteUrl}/_api/social.following/my/stopfollowing;

Passing the same actorinfo to both calls.

I have verified the user is being followed, and the pnp.js code does correctly retrieve the user as a followed user in sp.social.my.followed calls.
not sure when it stopped working - have not tested this feature in a few months.

The stopFollowing is returning an object with null value :
{
"odata.metadata": "https://[tenant]sites/testsite/_api/$metadata#Edm.Null",
"odata.null": true
}

the api call returns response status of 204 (no response body). According to documentation it should be true or false (is user still being followed)

Steps to reproduce

  1. create spfx webpart that calls sp.social.my.followed and shows the user a button for each to call the stopFollowing
  2. click the button - refresh the page - the user is still being followed.3.

Expected behavior

a call to either the pnp or the api should remove the user from the followed list.

Metadata

Metadata

Assignees

Labels

Needs: Author FeedbackAwaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.sharepoint-developer-supportsharepoint-developer-supporttype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions