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

Feature/json exporter #5354

Merged
merged 1 commit into from Dec 17, 2014

Conversation

Projects
None yet
6 participants
@gdpelican
Contributor

gdpelican commented Oct 19, 2014

A quick first pass at a JSON exporter. Would welcome some feedback around which fields are required, useful, etc.

For #5343

Note that this hasn't touched the XML export functionality at all.

@jaywink

This comment has been minimized.

Show comment
Hide comment
@jaywink

jaywink Oct 19, 2014

Contributor

Awesome, thanks for working on this extremely important feature!

Will check in more detail later.

As a general comment relating to exporters, I guess ideally we should aim to push them to Sidekiq for processing - and then email the user a link to the file (auto-expiry of file). But would this be a problem for pods on Heroku for example? Solved with S3 support?

Contributor

jaywink commented Oct 19, 2014

Awesome, thanks for working on this extremely important feature!

Will check in more detail later.

As a general comment relating to exporters, I guess ideally we should aim to push them to Sidekiq for processing - and then email the user a link to the file (auto-expiry of file). But would this be a problem for pods on Heroku for example? Solved with S3 support?

@gdpelican

This comment has been minimized.

Show comment
Hide comment
@gdpelican

gdpelican Oct 19, 2014

Contributor

Yeah, thought about emailing them their data, but can't do it directly with the potential json size. Heroku would probably preclude storing it locally, but uploading could be a solution.

Maybe after the file's done processing we create an Export model, which uploads the file to S3 and auto-explodes in like 3 days, James Bond-style.

class Export < ActiveModel::Base
  belongs_to :user
  has_attached_file :exported_data
  after_create :schedule_deletion

  def schedule_deletion
    # schedule another sidekiq to destroy this model 
  end
end

??

Contributor

gdpelican commented Oct 19, 2014

Yeah, thought about emailing them their data, but can't do it directly with the potential json size. Heroku would probably preclude storing it locally, but uploading could be a solution.

Maybe after the file's done processing we create an Export model, which uploads the file to S3 and auto-explodes in like 3 days, James Bond-style.

class Export < ActiveModel::Base
  belongs_to :user
  has_attached_file :exported_data
  after_create :schedule_deletion

  def schedule_deletion
    # schedule another sidekiq to destroy this model 
  end
end

??

@jhass

This comment has been minimized.

Show comment
Hide comment
@jhass

jhass Oct 19, 2014

Member

In either case, we should consider running the result through gzip, that'll drastically reduce the filesize.

Member

jhass commented Oct 19, 2014

In either case, we should consider running the result through gzip, that'll drastically reduce the filesize.

@jaywink

This comment has been minimized.

Show comment
Hide comment
@jaywink

jaywink Nov 22, 2014

Contributor

OK revisiting this, sorry for taking so long.

I think initially it's ok if we build 'n' serve the file as it is done now in runtime as long as we don't have large data included - eg comments and posts. When those arrive, we need to push the processing into sidekiq.

Agreed?

Also, the JSON isn't actual JSON in my env at least, it's like:

{:name=>"jaywink@localhost:3000", :email=>"mail@jasonrobinson.me", :serialized_private_key=>"-----BEGIN RSA PRIVATE KEY-----\nMIIJKQIBAAKCAgEAtMQTCTnPaUCzoNSzDFlZSoRXHEOkHjcBoXybUs7K15Ny9Bbz\nnbvrQmhG7LUxJ29On8jkvnHe7JWMfLztIHMjMe2sqcruo003KcahT2i9I3Zd6nSm\n
.....

And so on.

Otherwise, once the format and what attributes to include have been tweaked - would love to get this merged!

Contributor

jaywink commented Nov 22, 2014

OK revisiting this, sorry for taking so long.

I think initially it's ok if we build 'n' serve the file as it is done now in runtime as long as we don't have large data included - eg comments and posts. When those arrive, we need to push the processing into sidekiq.

Agreed?

Also, the JSON isn't actual JSON in my env at least, it's like:

{:name=>"jaywink@localhost:3000", :email=>"mail@jasonrobinson.me", :serialized_private_key=>"-----BEGIN RSA PRIVATE KEY-----\nMIIJKQIBAAKCAgEAtMQTCTnPaUCzoNSzDFlZSoRXHEOkHjcBoXybUs7K15Ny9Bbz\nnbvrQmhG7LUxJ29On8jkvnHe7JWMfLztIHMjMe2sqcruo003KcahT2i9I3Zd6nSm\n
.....

And so on.

Otherwise, once the format and what attributes to include have been tweaked - would love to get this merged!

@jaywink

This comment has been minimized.

Show comment
Hide comment
@jaywink

jaywink Nov 22, 2014

Contributor

Also one other thing. I think we should include the diaspora* version that exported the file from day one. The tricky thing is how to get this, since any develop version pods would just report head.

@jhass any ideas? Kinda difficult how we replace the version in defaults.version.number currently.. Having the real version number there always would be nice and then having defaults.version.head True/False would be something that would work better - but I guess that would change quite many things..

Contributor

jaywink commented Nov 22, 2014

Also one other thing. I think we should include the diaspora* version that exported the file from day one. The tricky thing is how to get this, since any develop version pods would just report head.

@jhass any ideas? Kinda difficult how we replace the version in defaults.version.number currently.. Having the real version number there always would be nice and then having defaults.version.head True/False would be something that would work better - but I guess that would change quite many things..

Show outdated Hide outdated app/models/user.rb
@@ -45,6 +47,8 @@ class User < ActiveRecord::Base
has_many :invitations_from_me, :class_name => 'Invitation', :foreign_key => :sender_id
has_many :invitations_to_me, :class_name => 'Invitation', :foreign_key => :recipient_id
has_many :aspects, -> { order('order_id ASC') }
has_many :posts, through: :person

This comment has been minimized.

@jaywink

jaywink Nov 22, 2014

Contributor

If we outscope posts and comments from this pull, these two should be removed to be added later.

@jaywink

jaywink Nov 22, 2014

Contributor

If we outscope posts and comments from this pull, these two should be removed to be added later.

Show outdated Hide outdated app/serializers/export/aspect_serializer.rb
module Export
class AspectSerializer < ActiveModel::Serializer
attributes :name,
:contacts_visible

This comment has been minimized.

@jaywink

jaywink Nov 22, 2014

Contributor

Development head has recently added a chat_enabled flag to Aspect - that should be included here now too :)

@jaywink

jaywink Nov 22, 2014

Contributor

Development head has recently added a chat_enabled flag to Aspect - that should be included here now too :)

Show outdated Hide outdated app/serializers/export/comment_serializer.rb
@@ -0,0 +1,10 @@
module Export
class CommentSerializer < ActiveModel::Serializer

This comment has been minimized.

@jaywink

jaywink Nov 22, 2014

Contributor

If we outscope posts and comments from this pull, this should be removed for later addition.

@jaywink

jaywink Nov 22, 2014

Contributor

If we outscope posts and comments from this pull, this should be removed for later addition.

Show outdated Hide outdated app/serializers/export/post_serializer.rb
@@ -0,0 +1,17 @@
module Export
class PostSerializer < ActiveModel::Serializer

This comment has been minimized.

@jaywink

jaywink Nov 22, 2014

Contributor

If we outscope posts and comments from this pull, this should be removed for later addition.

@jaywink

jaywink Nov 22, 2014

Contributor

If we outscope posts and comments from this pull, this should be removed for later addition.

Show outdated Hide outdated app/serializers/export/profile_serializer.rb
:gender,
:bio,
:location
end

This comment has been minimized.

@jaywink

jaywink Nov 22, 2014

Contributor

The following need to be added imho

  • last_name (it's still kinda there, see #3648)
  • image_url
  • diaspora_handle
  • searchable
  • nsfw
@jaywink

jaywink Nov 22, 2014

Contributor

The following need to be added imho

  • last_name (it's still kinda there, see #3648)
  • image_url
  • diaspora_handle
  • searchable
  • nsfw
Show outdated Hide outdated app/serializers/export/user_serializer.rb
has_many :posts, each_serializer: Export::PostSerializer
has_many :aspects, each_serializer: Export::AspectSerializer
has_many :contacts, each_serializer: Export::ContactSerializer

This comment has been minimized.

@jaywink

jaywink Nov 22, 2014

Contributor

Missing attrs:

  • username
  • disable_mail
  • show_community_spotlight_stream
  • auto_follow_back
  • auto_follow_back_aspect (There is only _in for this so it would need to fetch aspect name here!)

Also, I would remove serialized_private_key. IMHO we should not include that here, rather when it needs to be exported IMHO there should be a separate button to do that, maybe it could popup the text in a dialog.

Opinions?

Also, if we outscope posts and comments from this pull, those parts should obviously not be here.

@jaywink

jaywink Nov 22, 2014

Contributor

Missing attrs:

  • username
  • disable_mail
  • show_community_spotlight_stream
  • auto_follow_back
  • auto_follow_back_aspect (There is only _in for this so it would need to fetch aspect name here!)

Also, I would remove serialized_private_key. IMHO we should not include that here, rather when it needs to be exported IMHO there should be a separate button to do that, maybe it could popup the text in a dialog.

Opinions?

Also, if we outscope posts and comments from this pull, those parts should obviously not be here.

Show outdated Hide outdated config/locales/diaspora/en.yml
@@ -1247,6 +1247,7 @@ en:
current_password_expl: "the one you sign in with..."
character_minimum_expl: "must be at least six characters"
download_xml: "download my xml"
download_json: "download my json"

This comment has been minimized.

@jaywink

jaywink Nov 22, 2014

Contributor

Can we just remove the xml link totally? It's malformed (#4032) doesn't include any useful data that this new json exporter wouldn't include?

Also, then the button could be called just download my profile.

@jaywink

jaywink Nov 22, 2014

Contributor

Can we just remove the xml link totally? It's malformed (#4032) doesn't include any useful data that this new json exporter wouldn't include?

Also, then the button could be called just download my profile.

This comment has been minimized.

@gdpelican

gdpelican Nov 22, 2014

Contributor

That's be great. Wasn't sure if the XML link's actually useful at all.

@gdpelican

gdpelican Nov 22, 2014

Contributor

That's be great. Wasn't sure if the XML link's actually useful at all.

@jaywink jaywink referenced this pull request Nov 22, 2014

Open

User data export / (partial) import metaissue #5343

5 of 7 tasks complete
@jhass

This comment has been minimized.

Show comment
Hide comment
@jhass

jhass Nov 22, 2014

Member

Maybe we should just give the export format its own version. Including the current release won't help much for the dev version, since you still don't know if it was 0.5.0.0dev prior the breaking change or 0.5.0.0dev after the breaking change.

Member

jhass commented Nov 22, 2014

Maybe we should just give the export format its own version. Including the current release won't help much for the dev version, since you still don't know if it was 0.5.0.0dev prior the breaking change or 0.5.0.0dev after the breaking change.

@gdpelican

This comment has been minimized.

Show comment
Hide comment
@gdpelican

gdpelican Nov 28, 2014

Contributor

Alright, finally got some time to sit down with this for a little bit. Should be ready for another look @jaywink

Contributor

gdpelican commented Nov 28, 2014

Alright, finally got some time to sit down with this for a little bit. Should be ready for another look @jaywink

Show outdated Hide outdated lib/diaspora/exporter.rb
def strategy(format)
@strategy ||= case format
when :json then Exporters::JSON
when :xml then Exporters::XML

This comment has been minimized.

@jaywink

jaywink Dec 7, 2014

Contributor

Can we just drop everything related to the old XML user exporter? A community decision already accepted XML as the new format, the old one doesn't really work anyway.

Objections anyone?

@jaywink

jaywink Dec 7, 2014

Contributor

Can we just drop everything related to the old XML user exporter? A community decision already accepted XML as the new format, the old one doesn't really work anyway.

Objections anyone?

This comment has been minimized.

@goobertron

goobertron Dec 7, 2014

A community decision already accepted XML as the new format

Shurely JSON, not XML?

@goobertron

goobertron Dec 7, 2014

A community decision already accepted XML as the new format

Shurely JSON, not XML?

This comment has been minimized.

@jaywink

jaywink Dec 7, 2014

Contributor

Yeah :D

On 7 December 2014 16:19:03 EET, goob notifications@github.com wrote:

@@ -5,12 +5,24 @@
module Diaspora

class Exporter

  • def initialize(strategy)
  •  self.class.send(:include, strategy)
    
  • def initialize(format = :json)
  •  self.class.include strategy(format) if
    
    strategy(format).present?
  • end
  • def strategy(format)
  •  @strategy ||= case format
    
  •    when :json then Exporters::JSON
    
  •    when :xml  then Exporters::XML
    

A community decision already accepted XML as the new format

Shurely JSON, not XML?


Reply to this email directly or view it on GitHub:
https://github.com/diaspora/diaspora/pull/5354/files#r21424879

Br,
Jason Robinson
https://jasonrobinson.me

@jaywink

jaywink Dec 7, 2014

Contributor

Yeah :D

On 7 December 2014 16:19:03 EET, goob notifications@github.com wrote:

@@ -5,12 +5,24 @@
module Diaspora

class Exporter

  • def initialize(strategy)
  •  self.class.send(:include, strategy)
    
  • def initialize(format = :json)
  •  self.class.include strategy(format) if
    
    strategy(format).present?
  • end
  • def strategy(format)
  •  @strategy ||= case format
    
  •    when :json then Exporters::JSON
    
  •    when :xml  then Exporters::XML
    

A community decision already accepted XML as the new format

Shurely JSON, not XML?


Reply to this email directly or view it on GitHub:
https://github.com/diaspora/diaspora/pull/5354/files#r21424879

Br,
Jason Robinson
https://jasonrobinson.me

Show outdated Hide outdated lib/diaspora/exporter.rb
end
end
module Exporters
module JSON
def execute(user)
@export ||= ::JSON.generate Export::UserSerializer.new(user, root: false).as_json

This comment has been minimized.

@jaywink

jaywink Dec 7, 2014

Contributor

Could we somehow get a "export_version" key to the root level of the json? Just call it 1.0 for now, we can increment it semantically and when we have a proper json-schema written for this, link to that. But for now I think just the key and 1.0 is good enough.

But it needs IMHO to be on the root level, not inside the user object, so something like (for example):

{"export_version": "1.0",
 "user": { .... },
}
@jaywink

jaywink Dec 7, 2014

Contributor

Could we somehow get a "export_version" key to the root level of the json? Just call it 1.0 for now, we can increment it semantically and when we have a proper json-schema written for this, link to that. But for now I think just the key and 1.0 is good enough.

But it needs IMHO to be on the root level, not inside the user object, so something like (for example):

{"export_version": "1.0",
 "user": { .... },
}

This comment has been minimized.

@jhass

jhass Dec 7, 2014

Member

I'd go for just version, the export_ seems redundant.

@jhass

jhass Dec 7, 2014

Member

I'd go for just version, the export_ seems redundant.

@jaywink

This comment has been minimized.

Show comment
Hide comment
@jaywink

jaywink Dec 7, 2014

Contributor

Thanks @gdpelican I'll check the export asap on my dev environment, hopefully tonight. I think this is pretty close, personally I think we should drop the XML stuff already. If no one objects within a few days, feel free to do it IMHO :)

Contributor

jaywink commented Dec 7, 2014

Thanks @gdpelican I'll check the export asap on my dev environment, hopefully tonight. I think this is pretty close, personally I think we should drop the XML stuff already. If no one objects within a few days, feel free to do it IMHO :)

@jaywink

This comment has been minimized.

Show comment
Hide comment
@jaywink

jaywink Dec 7, 2014

Contributor

Quick test in dev env, looks ok to me. Note it's not prettyfied of course normally, I prettified it.

One thing that needs fixing is that contacts don't show which aspect they have been added to. The one contact here below is in the "Friends" aspect, but the json doesn't show that in any way.

{
    "name": "foobar@localhost:3000",
    "email": "foobar@example.com",
    "language": "en",
    "username": "foobar",
    "disable_mail": false,
    "show_community_spotlight_in_stream": true,
    "auto_follow_back": true,
    "auto_follow_back_aspect": "Acquaintances",
    "profile": {
        "first_name": "",
        "last_name": "",
        "gender": "",
        "bio": "### Markdown header\r\n\r\n> quote\r\n\r\n   code para\r\n\r\nFoo",
        "location": "Hki",
        "image_url": "/assets/user/default.png",
        "diaspora_handle": "foobar@localhost:3000",
        "searchable": true,
        "nsfw": false
    },
    "aspects": [{
        "name": "Family",
        "contacts_visible": true,
        "chat_enabled": false
    }, {
        "name": "Friends",
        "contacts_visible": true,
        "chat_enabled": false
    }, {
        "name": "Work",
        "contacts_visible": true,
        "chat_enabled": false
    }, {
        "name": "Acquaintances",
        "contacts_visible": true,
        "chat_enabled": false
    }],
    "contacts": [{
        "sharing": false,
        "receiving": true,
        "person_guid": "bed18bf02ee001323b1010c37b6c3c6f",
        "person_name": "jaywink@localhost:3000",
        "person_first_name": "jaywink",
        "person_diaspora_handle": "jaywink@localhost:3000"
    }]
}
Contributor

jaywink commented Dec 7, 2014

Quick test in dev env, looks ok to me. Note it's not prettyfied of course normally, I prettified it.

One thing that needs fixing is that contacts don't show which aspect they have been added to. The one contact here below is in the "Friends" aspect, but the json doesn't show that in any way.

{
    "name": "foobar@localhost:3000",
    "email": "foobar@example.com",
    "language": "en",
    "username": "foobar",
    "disable_mail": false,
    "show_community_spotlight_in_stream": true,
    "auto_follow_back": true,
    "auto_follow_back_aspect": "Acquaintances",
    "profile": {
        "first_name": "",
        "last_name": "",
        "gender": "",
        "bio": "### Markdown header\r\n\r\n> quote\r\n\r\n   code para\r\n\r\nFoo",
        "location": "Hki",
        "image_url": "/assets/user/default.png",
        "diaspora_handle": "foobar@localhost:3000",
        "searchable": true,
        "nsfw": false
    },
    "aspects": [{
        "name": "Family",
        "contacts_visible": true,
        "chat_enabled": false
    }, {
        "name": "Friends",
        "contacts_visible": true,
        "chat_enabled": false
    }, {
        "name": "Work",
        "contacts_visible": true,
        "chat_enabled": false
    }, {
        "name": "Acquaintances",
        "contacts_visible": true,
        "chat_enabled": false
    }],
    "contacts": [{
        "sharing": false,
        "receiving": true,
        "person_guid": "bed18bf02ee001323b1010c37b6c3c6f",
        "person_name": "jaywink@localhost:3000",
        "person_first_name": "jaywink",
        "person_diaspora_handle": "jaywink@localhost:3000"
    }]
}
@jaywink

This comment has been minimized.

Show comment
Hide comment
@jaywink

jaywink Dec 7, 2014

Contributor

Also, date of birth is missing from the profile fields :)

Contributor

jaywink commented Dec 7, 2014

Also, date of birth is missing from the profile fields :)

@jaywink

This comment has been minimized.

Show comment
Hide comment
@jaywink

jaywink Dec 7, 2014

Contributor

Also, something odd related to the exporter, but that is probably the fault of the profile system and not the exporter itself. Just after creating the profile it looks like this:

    "first_name": null,
    "last_name": null,

But after saving it once, it looks like this:

    "first_name": "",
    "last_name": "",

So we probably have a bug in profile creation, setting fields to null, since the save does things differently.

Contributor

jaywink commented Dec 7, 2014

Also, something odd related to the exporter, but that is probably the fault of the profile system and not the exporter itself. Just after creating the profile it looks like this:

    "first_name": null,
    "last_name": null,

But after saving it once, it looks like this:

    "first_name": "",
    "last_name": "",

So we probably have a bug in profile creation, setting fields to null, since the save does things differently.

@gdpelican

This comment has been minimized.

Show comment
Hide comment
@gdpelican

gdpelican Dec 8, 2014

Contributor

@jaywink

Cool, so I

  • Added version 1.0 to the root of the exported json, pushing everything else into 'user'
  • Added birthday to the profile serializer
  • Added aspects to the contact serializer
  • Nuked the XML serializer entirely

Didn't get a chance to look at the null / "" profile name beyond having a chuckle at the checkbox tags wtf comment in the profiles_controller. (checkbox tags are, indeed, wtf.)
Strikes me as pretty low on the scale of broken?

Contributor

gdpelican commented Dec 8, 2014

@jaywink

Cool, so I

  • Added version 1.0 to the root of the exported json, pushing everything else into 'user'
  • Added birthday to the profile serializer
  • Added aspects to the contact serializer
  • Nuked the XML serializer entirely

Didn't get a chance to look at the null / "" profile name beyond having a chuckle at the checkbox tags wtf comment in the profiles_controller. (checkbox tags are, indeed, wtf.)
Strikes me as pretty low on the scale of broken?

@Flaburgan

This comment has been minimized.

Show comment
Hide comment
@Flaburgan

Flaburgan Dec 8, 2014

Member

Yeah I don't think you should worry about that in this PR.

Member

Flaburgan commented Dec 8, 2014

Yeah I don't think you should worry about that in this PR.

@@ -37,6 +37,8 @@ class User < ActiveRecord::Base
serialize :hidden_shareables, Hash
has_one :person, :foreign_key => :owner_id
has_one :profile, through: :person

This comment has been minimized.

@jaywink

jaywink Dec 8, 2014

Contributor

Quite a few tests are failing. I'm wondering if this is the cause? For example: AccountDeleter has all user association keys accounted for

Diff:
   @@ -13,7 +13,6 @@
     :invited_by,
     :notifications,
     :person,
   - :profile,
     :reports,
     :services,
     :tag_followings,

 # ./spec/lib/account_deleter_spec.rb:175:in `block (2 levels) in <top (required)>'

So the tests need a little check through, whether things are really "breaking" or just tests need patching.
Also, if you could clean the commit message and add a Changelog entry - I think this would be ready for merging.

@jaywink

jaywink Dec 8, 2014

Contributor

Quite a few tests are failing. I'm wondering if this is the cause? For example: AccountDeleter has all user association keys accounted for

Diff:
   @@ -13,7 +13,6 @@
     :invited_by,
     :notifications,
     :person,
   - :profile,
     :reports,
     :services,
     :tag_followings,

 # ./spec/lib/account_deleter_spec.rb:175:in `block (2 levels) in <top (required)>'

So the tests need a little check through, whether things are really "breaking" or just tests need patching.
Also, if you could clean the commit message and add a Changelog entry - I think this would be ready for merging.

@gdpelican

This comment has been minimized.

Show comment
Hide comment
@gdpelican

gdpelican Dec 11, 2014

Contributor

Pushed some test fixes, it seems like ActiveModelSerializer changes the default behaviour of render :json => @model a little bit; I was able to fix the failing tests by adding root: false to them.

(difference being {id: 1, name: 'name}with root: false, and {user: {id: 1, name: 'name'}}' with the defaulted root: true

Wonder if we should just turn off using the root element across the board for AMS, or if the tests passing is confidence enough that all the important json is still coming through correctly?

@jaywink

Contributor

gdpelican commented Dec 11, 2014

Pushed some test fixes, it seems like ActiveModelSerializer changes the default behaviour of render :json => @model a little bit; I was able to fix the failing tests by adding root: false to them.

(difference being {id: 1, name: 'name}with root: false, and {user: {id: 1, name: 'name'}}' with the defaulted root: true

Wonder if we should just turn off using the root element across the board for AMS, or if the tests passing is confidence enough that all the important json is still coming through correctly?

@jaywink

@gdpelican

This comment has been minimized.

Show comment
Hide comment
@gdpelican

gdpelican Dec 11, 2014

Contributor

Seems like there's still some frontend tests to fix up; I'll fix em up when I get the chance.

Contributor

gdpelican commented Dec 11, 2014

Seems like there's still some frontend tests to fix up; I'll fix em up when I get the chance.

@gdpelican

This comment has been minimized.

Show comment
Hide comment
@gdpelican

gdpelican Dec 11, 2014

Contributor

Cool, looks like that build's passing now.

Squashed 'er up and put in a message in the changelog as well.

Contributor

gdpelican commented Dec 11, 2014

Cool, looks like that build's passing now.

Squashed 'er up and put in a message in the changelog as well.

@Flaburgan

This comment has been minimized.

Show comment
Hide comment
@Flaburgan

Flaburgan Dec 11, 2014

Member

Hey, merge is close to you... :D

Member

Flaburgan commented Dec 11, 2014

Hey, merge is close to you... :D

Show outdated Hide outdated Changelog.md
## Json exporter functionality (Iteration 1)
Allows users to export their data in JSON format from their user settings page

This comment has been minimized.

@jhass

jhass Dec 11, 2014

Member

It's an important feature, but the big headings are for things the podmin needs to read and know for update ;)

@jhass

jhass Dec 11, 2014

Member

It's an important feature, but the big headings are for things the podmin needs to read and know for update ;)

Show outdated Hide outdated lib/diaspora/exporter.rb
builder.to_xml.to_s
end
def serialized_version

This comment has been minimized.

@jhass

jhass Dec 11, 2014

Member

I'd say make this a constant.

@jhass

jhass Dec 11, 2014

Member

I'd say make this a constant.

@@ -50,7 +50,7 @@ def normal_ar_user_associates_to_delete
end
def special_ar_user_associations
[:invitations_from_me, :person, :contacts, :auto_follow_back_aspect]
[:invitations_from_me, :person, :profile, :contacts, :auto_follow_back_aspect]

This comment has been minimized.

@jhass

jhass Dec 11, 2014

Member

Did you verify this doesn't change behavior? Like deleting the profile while it was just nulled previously?

@jhass

jhass Dec 11, 2014

Member

Did you verify this doesn't change behavior? Like deleting the profile while it was just nulled previously?

This comment has been minimized.

@gdpelican

gdpelican Dec 11, 2014

Contributor

I'll double check that.

I figured it was safe because it's one profile through a person, and we're deleting the person (why have an orphan profile?), but I'll check the existing functionality to see that it matches.

@gdpelican

gdpelican Dec 11, 2014

Contributor

I'll double check that.

I figured it was safe because it's one profile through a person, and we're deleting the person (why have an orphan profile?), but I'll check the existing functionality to see that it matches.

This comment has been minimized.

@jhass

jhass Dec 11, 2014

Member

We keep the person since we keep comments and need something to associate them to. And tbh. I wouldn't be surprised if there's code that explodes when there's a person without a profile.

@jhass

jhass Dec 11, 2014

Member

We keep the person since we keep comments and need something to associate them to. And tbh. I wouldn't be surprised if there's code that explodes when there's a person without a profile.

This comment has been minimized.

@gdpelican

gdpelican Dec 15, 2014

Contributor

I just threw a little test into the account deleter spec to verify that we're still just nullifying the profile; it passes before and after this change.

@gdpelican

gdpelican Dec 15, 2014

Contributor

I just threw a little test into the account deleter spec to verify that we're still just nullifying the profile; it passes before and after this change.

This comment has been minimized.

@jhass

jhass Dec 15, 2014

Member

Great, thanks!

@jhass

jhass Dec 15, 2014

Member

Great, thanks!

@jhass

This comment has been minimized.

Show comment
Hide comment
@jhass

jhass Dec 11, 2014

Member

Just some minor remarks, then this should be good :)

Member

jhass commented Dec 11, 2014

Just some minor remarks, then this should be good :)

Show outdated Hide outdated spec/lib/account_deleter_spec.rb
@profile_deletion.perform!
expect(@profile.reload.first_name).to be_blank
expect(@profile.reload.last_name).to be_blank
expect(@profile.reload.searchable).to be_falsey

This comment has been minimized.

@jhass

jhass Dec 15, 2014

Member

Actually, slight optimization nitpick here, reload returns self and updates the receiver, so just do it one time above the expectations.

@jhass

jhass Dec 15, 2014

Member

Actually, slight optimization nitpick here, reload returns self and updates the receiver, so just do it one time above the expectations.

@gdpelican

This comment has been minimized.

Show comment
Hide comment
@gdpelican

gdpelican Dec 16, 2014

Contributor

Ready for final sign-off I think @jaywink @jhass

Contributor

gdpelican commented Dec 16, 2014

Ready for final sign-off I think @jaywink @jhass

@jhass jhass added this to the next-major milestone Dec 17, 2014

@jhass

This comment has been minimized.

Show comment
Hide comment
@jhass

jhass Dec 17, 2014

Member

Alright, thank you!

Member

jhass commented Dec 17, 2014

Alright, thank you!

@jhass jhass closed this Dec 17, 2014

@jhass jhass reopened this Dec 17, 2014

jhass added a commit that referenced this pull request Dec 17, 2014

@jhass jhass merged commit 6806b2d into diaspora:develop Dec 17, 2014

1 check was pending

continuous-integration/travis-ci The Travis CI build is in progress
Details
@goobertron

This comment has been minimized.

Show comment
Hide comment
@goobertron

goobertron Dec 17, 2014

Thanks for your work on this, @gdpelican (and @jhass too).

Thanks for your work on this, @gdpelican (and @jhass too).

@Flaburgan

This comment has been minimized.

Show comment
Hide comment
@Flaburgan

Flaburgan Dec 17, 2014

Member

Nice! The first step for #5343 :D

Thank you @gdpelican @jhass and @jaywink

Member

Flaburgan commented Dec 17, 2014

Nice! The first step for #5343 :D

Thank you @gdpelican @jhass and @jaywink

@Flaburgan

This comment has been minimized.

Show comment
Hide comment
@Flaburgan

Flaburgan Dec 17, 2014

Member

Just pulled this on d-fr, I tested it with my account (more than 1000 contacts). I put it in http://jsonlint.com/ and it says "valid" :)

Member

Flaburgan commented Dec 17, 2014

Just pulled this on d-fr, I tested it with my account (more than 1000 contacts). I put it in http://jsonlint.com/ and it says "valid" :)

@svbergerem

This comment has been minimized.

Show comment
Hide comment
@svbergerem

svbergerem Dec 17, 2014

Member

Awesome! Nice work @gdpelican!

Member

svbergerem commented Dec 17, 2014

Awesome! Nice work @gdpelican!

@ghost ghost referenced this pull request Jan 24, 2015

Closed

Post date to json export #5585

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment