Y said

There has been a bit of a lifestyle change recently. Moved, moved closer to work.

This gives me a lot of room to maneuver, like go for a run in the morning. After the run, I still had a little time to write my blog, so I spent a few mornings rushing to write the article I had wanted to write for a long time.

Usually also can accumulate some inspiration to write a blog, write slowly behind it.

Some time later, I want to try short videos to talk about some technical topics or programming practice.

A permission bug

Not long ago accidentally found a wechat circle of friends permission bug.

The thing is, I usually post some updates on wechat moments.

Because I’m “too shy,” a lot of things tend to block out leaders in the company in general, and occasionally colleagues. For example, occasionally write articles on the public account, will also screen them (to prevent them from discovering the fact that I am too dishes).

Wechat circle of friends is to support this simple permission control requirements, in the moments of friends, you can choose: all friends visible, only their own visible, not to see, only to see who.

In this case, I generally don’t show the labels “leader” and “colleague.”

I hit send, there’s no problem, they can’t see it.

Until I added a colleague’s wechat (never added before)…

I made sure I tagged him as a “colleague” before I added it, and he was able to see my feed!!

Is that a bug? I think it certainly counts! I deliberately set the permissions not to show to my colleagues, but my new friends can ignore the Settings and see this news directly!

This reminds me of a colleague I added before, the next day she said my official account articles are good. My heart a question mark, thought I didn’t shield you?? Now it seems to be the cause of this bug.

The design of circle of friends

If you were asked to design a circle of friends, what would you do?

It is not difficult to design the functions of a circle of friends, but it is difficult to maintain high performance in such a large daily life of wechat. There are two common designs: push and pull. Suitable for different scenarios.

The so-called tweet mode is when a user posts a news feed and then pushes it to all his friends. In this way, when everyone is brushing moments, they only need to display the dynamic information they receive in the order they receive it.

The so-called pull mode refers to a user in the moment of scrolling friends, to request all his friends’ recent dynamic, and then sorted display.

Let’s take a look at how wechat is designed. Moments currently have two entrances:

  1. Click Discover – Circle of Friends, you can see your friends posted dynamic

  2. Click on a friend’s profile picture – moments, you can see this friend’s activity

For the first service scenario, push mode is better than pull mode. If pull mode is used, we need to send a large number of network requests at the same time, deal with some request failures, verify permissions before getting data, and deal with sorting after getting data, etc.

In the second business scenario, the pull model is clearly better than the push model. Since you’re checking a single friend’s feed, there’s no problem.

Permission design

Let’s start with product design. When we post on moments, we can choose who is visible and who is not. If you use push mode, it’s very easy to control permissions, just figure out who you want to push, and push it to those people. Other people can’t receive the feed, so they can’t see the feed.

As we all know, once the moments are published, the content can not be modified, nor can the permission be modified. So there will be no subsequent maintenance issues with permission changes.

According to this logic, if I were in A minute ago sent A circle of friends, and then added A new friend, A friend at this time of A circle of friends is can’t see we just send the dynamic (even if he should have permissions), because we didn’t push him, unless WeChat when friends did push operation, I didn’t try, but not do push operation, Interested readers can do an experiment to see if there is one.

If friend A clicks my profile picture to enter my moments, he can see the dynamic I just posted. In theory, you should have done a permission check when you pulled it, but apparently wechat didn’t.

This permission verification is not complicated and does not require high performance. Let’s use a graph to illustrate:

So I understand that this is not a technical implementation issue, but a pure product issue, without considering the business scenario. But this is a usage scenario that I do come across a lot. I don’t know when it will be fixed and how long it will take, but I hope it can be fixed soon ~

What are the drawbacks of the push model?

Finally, let’s talk about push patterns. The push mode is suitable for service scenarios with few friends. Generally, there are two business scenarios in the development dynamic service:

  1. Two-way attention, such as wechat friends, A and B follow each other, and each other can see the news
  2. One-way attention, such as weibo, A follows B, then B sent dynamic A can see, but A sent dynamic B can not see.

If it is one-way attention, it is not suitable to use the push mode. For example, a big V has tens of millions of fans. If it uses the push mode, it will send a dynamic message to push to these tens of millions of people. So the pull mode is more suitable for this one-way focus scenario.

However, one-way following is sometimes used in a combination of push and pull mode. Set a threshold (say 10,000) and if the number of followers is less than this threshold, use push mode, otherwise use pull mode.

The maximum number of wechat friends is 5000, so it is ok to use the tweet mode. Combined with the permissions mentioned above, it is estimated that this pattern should be used. But it is not clear what else will be implemented.

And a support

My name is Yasin, a blogger who insists on original technology. My wechat official account is: Made a Program

All see here, if feel my article write also ok, might as well support once.

The first article will be sent to the public account, the best reading experience, welcome your attention.

Your every retweet, attention, like, comment is the biggest support for me!

There are learning resources, and frontline Internet companies within the push oh

And a support

My name is Yasin, a blogger who insists on original technology. My wechat official account is: Made a Program

All see here, if feel my article write also ok, might as well support once.

The first article will be sent to the public account, the best reading experience, welcome your attention.

Your every retweet, attention, like, comment is the biggest support for me!

There are learning resources, and frontline Internet companies within the push oh