Merge branch 'stable' into develop

This commit is contained in:
Jonne Haß 2015-05-10 00:10:19 +02:00
commit 59e77675ce
3 changed files with 17 additions and 3 deletions

View file

@ -21,6 +21,7 @@ Ruby 2.0 is no longer officially supported.
* Dropped db/seeds.rb [#5896](https://github.com/diaspora/diaspora/pull/5896) * Dropped db/seeds.rb [#5896](https://github.com/diaspora/diaspora/pull/5896)
* Drop broken install scripts [#5907](https://github.com/diaspora/diaspora/pull/5907) * Drop broken install scripts [#5907](https://github.com/diaspora/diaspora/pull/5907)
* Improve invoking mobile site in the testsuite [#5915](https://github.com/diaspora/diaspora/pull/5915) * Improve invoking mobile site in the testsuite [#5915](https://github.com/diaspora/diaspora/pull/5915)
* Do not retry a couple of unrecoverable job failures [#5938](https://github.com/diaspora/diaspora/pull/5938)
## Bug fixes ## Bug fixes
* Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846) * Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846)

View file

@ -14,11 +14,24 @@ module Workers
rescue Diaspora::ContactRequiredUnlessRequest, rescue Diaspora::ContactRequiredUnlessRequest,
Diaspora::RelayableObjectWithoutParent, Diaspora::RelayableObjectWithoutParent,
# Friendica seems to provoke these # Friendica seems to provoke these
Diaspora::AuthorXMLAuthorMismatch => e Diaspora::AuthorXMLAuthorMismatch,
# We received a private object to our public endpoint, again something
# Friendica seems to provoke
Diaspora::NonPublic => e
Rails.logger.info("error on receive: #{e.class}") Rails.logger.info("error on receive: #{e.class}")
rescue ActiveRecord::RecordInvalid => e rescue ActiveRecord::RecordInvalid => e
Rails.logger.info("failed to save received object: #{e.record.errors.full_messages}") Rails.logger.info("failed to save received object: #{e.record.errors.full_messages}")
raise e unless e.message.match(/already been taken/) raise e unless e.message.match(/already been taken/)
rescue ActiveRecord::RecordNotUnique => e
Rails.logger.info("failed to save received object: #{e.record.errors.full_messages}")
raise e unless %w(
index_comments_on_guid
index_likes_on_guid
index_posts_on_guid
"duplicate key in table 'comments'"
"duplicate key in table 'likes'"
"duplicate key in table 'posts'"
).any? {|index| e.message.include? index }
end end
end end
end end

View file

@ -56,7 +56,7 @@ class Postzord::Receiver::Public < Postzord::Receiver
# @return [Object] # @return [Object]
def save_object def save_object
@object = Diaspora::Parser::from_xml(@salmon.parsed_data) @object = Diaspora::Parser::from_xml(@salmon.parsed_data)
raise "Object is not public" if object_can_be_public_and_it_is_not? raise Diaspora::NonPublic if object_can_be_public_and_it_is_not?
raise Diaspora::RelayableObjectWithoutParent if object_must_have_parent_and_does_not? raise Diaspora::RelayableObjectWithoutParent if object_must_have_parent_and_does_not?
raise Diaspora::AuthorXMLAuthorMismatch if author_does_not_match_xml_author? raise Diaspora::AuthorXMLAuthorMismatch if author_does_not_match_xml_author?
@object.save! if @object && @object.respond_to?(:save!) @object.save! if @object && @object.respond_to?(:save!)