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
JSON Exporter, part deux #5499
JSON Exporter, part deux #5499
Conversation
@@ -505,6 +518,6 @@ def clearable_fields | |||
"created_at", "updated_at", "locked_at", | |||
"serialized_private_key", "getting_started", | |||
"disable_mail", "show_community_spotlight_in_stream", | |||
"email", "remove_after"] | |||
"email", "remove_after", "export"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should export get cleared when we do user.clear_account!
? I'd imagine so...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds right.
Speaking of the mails, we should keep in mind that sending mails is entirely optional and not configured by default. |
Hm, I don't think sending emails should be a hard dependency for this feature, it's more of a nice-to-have. How about something like this: When you visit your profile page If you have not requested an export If you have requested an export and it is not complete If you have requested an export and it is complete |
That looks like a nice solution ;) |
Alright, I've changed it so the data is GZipped and added in posts and comments to the serializers (might need some feedback on which fields want to be there) It'd be cool to get your take on this, @jaywink ? |
end | ||
|
||
def perform_export! | ||
export = Tempfile.new([username, '.json'], encoding: 'ascii-8bit') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm why is the encoding ascii-8bit
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ASCII-8bit is Rubys clunky way of saying BINARY (which is an alias for ASCII-8bit in fact). Remember, ASCII is a 7bit encoding ;) Since we write gzipped data here, that's correct.
Other than the comments relating to the attributes, super awesome work |
Oh also, I'm assuming this will work fine with pods using S3 for storage etc? |
:image_width, | ||
:likes_count, | ||
:comments_count, | ||
:reshares_count, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Counter caches, shouldn't be included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't it contain the current (when exported) count though? IMHO that is relevant information for the user :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should, I don't see much value in that information though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it could be valuable for some - imagine you want to look at some old export of your data from an old pod for example. Maybe someone will make an app to analyse exports and rank posts with most likes etc.
Also, before merging, the changelog entry for the export should probably be refreshed. I guess the export version does not need to be bumped since the current export version hasn't gone stable yet. |
I haven't been able to test using an S3 instance, but I just aped the Carrierwave uploaders for images, so it shouldn't behave any differently. |
e24431f
to
289ca3a
Compare
Well, I b0rked the rebase a little, but merged in Also made it so we export files in a .json.gz file, which 7zip should handle. |
4286062
to
1c69dd7
Compare
Alright, no more comments to this and looks awesome to me - merging! Nice to get this in to the next release, thanks @gdpelican ! |
Awesome! |
@Flaburgan > I tried yesterday night but it still shows me "We are currently processing your data. Please check back in a few moments." this morning. I'm pretty sure there is a problem ;). |
Oh noes! I'll have a poke at it tomorrow to see what's up. We're sure On Sat, Jan 17, 2015 at 11:22 PM, Marien Fressinaud <
|
Yeah sidekiq is running, Marien and my jobs are listed in "Enqueued". They are the only two jobs in the queue. |
|
Confirmed, adding export_user there immediately made the jobs processed. But the message on the panel is still |
Indeed but I have a different message: |
Yes, sure. |
@gdpelican the sidekiq queue thingy is fixed now, no need to check that :) |
Thought I'd share this for a little feedback if you'd care to give it a look @jhass @jaywink
This currently:
It doesn't: