Instapy: followRestriction.json contain duplicated

Created on 22 Jan 2019  路  11Comments  路  Source: timgrossmann/InstaPy

Expected Behavior

single user will not appear more than once

Current Behavior

I see 2 users that do appear twice
I also see that those users follow/unfollowed 2 times.

Possible Solution (optional)

@uluQulu latest changes is related ?

BUG ?

bug wontfix

All 11 comments

So what did happen is that the integration from old method to new method created new user for the account and all provius followed are ignored.

Also user changing name will not use the old followers restrictions.

I don't see anywhere we read the old followRestriction.json file to the new database ?!

I don't see anywhere we read the old followRestriction.json file to the new database ?!

That JSON file is being generated only to be used by users and is never being used internally.
Internal usage relies on data stored at the followRestriction table of the DB file in use.

That JSON is being generated by the data in that table before ending sessions.

To preserve the old data stored there before my PR having those changed was merged,
I added the option to have old data in there also preserved.
image

I wrote all of them in my PR that did bring those changes.

For more details, you can read from that PR.
@sionking, I will read about the issue you have raised here soon gets a free time.


That PR is #2563

Cheers 馃榿

@uluQulu so yo ujust expect ppl to manually copy paste a JSON file ?!
Y not handling it in the code ?

Also you will fail when user change his name

@sionking

@uluQulu so yo ujust expect ppl to manually copy paste a JSON file ?!
Y not handling it in the code ?

No. It is outside the usage of InstaPy.
If you like it, implement it and maybe share with the community.

Also you will fail when user change his name

Sorry, what?


You want to interfere InstaPy usage.

  1. InstaPy follows a user and then stores it to the DB file's followRestriction table.
  1. What you want to do is add some data to that table manually.

I wrote about it in that PR of mine - #2563.

image

You just don't read my PR descriptions which is what causes this confusion.


Cheers 馃榿

@uluQulu I did read it. And I think it is a big hole to jsut loose the old database.
Writing about it don't make it OK.

When a username in IG changes the database will create a new user and ditch the old data.

@sionking

Writing about it don't make it OK.

Exactly, but writing about it clears it up so that somebody outside discussion and code history can also understand it easily.
Also it's always best to know the recommended method from the implementer himself/herself.

Apart from that,
Before I made that data storage switch,
There were no any function that moved your custom data to the JSON file in use.
You had to do it by hand, manually.
And today and yesterday InstaPy never told anywhere that - "_Hey, if you want to load/merge custom data into actual data, do this.._"

So I did not deprecate anything in those regards.
And after that data storage switch [JSON to DB] you will have to do it the same way - manually.
Well, JSON is human-readable and you could do it easily.
But DBes are not, you will have to run a few SQL commands to do it which is also easy.

So, if you had that difficulty of MANUAL WORK - then sorry, and I think DB switch with its SUPER data integrity DOES worth such a temporary difficulty for CERTAIN users' USE CASE.

But please, don't try to blame me for sort-of I have deprecated some functionality, cos I did not.


Cheers 馃榿

@sionking

It's up to you to write that data loader/merger function and maybe share with the community if it is good.

I still think it is not so important to restore old data even if you write a super smart loader/merger feature.
image

And I think it is a big hole to jsut loose the old database.

Same 馃憜馃徏馃憜馃徏 old database is not so important [in normal usage].
But also remember that, I made that data storage switch only once [from JSON to DB] and I don't do it every day.

When a username in IG changes the database will create a new user and ditch the old data.

Exactly, but it can occur occasionally.
As I said, old data is not so important 馃憜馃徏馃憜馃徏馃憜馃徏


Yeah, if you have a crazy usage,

  • changing username every week;
  • using data at followRestriction table for VARIOUS PURPOSES else than it's role at _InstaPy_;

Well, then yes. You should look for ways to restore old data..


But in the end,
it can be best to handle those scenarios optionally (_enabled by default_).

  • writing a great custom data loader/merger function;
  • writing another function to convert profile name at DB tables after you change it at IG;

Can you do it [since you want it]?


Cheers 馃榿

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this problem still occurs, please open a new issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Spyd3r0us picture Spyd3r0us  路  3Comments

Naramsim picture Naramsim  路  3Comments

converge picture converge  路  3Comments

harrypython picture harrypython  路  3Comments

CharlesCCC picture CharlesCCC  路  3Comments