Reputation: 1455
Upon update of Redmine Issues, we are fetching the new data using the API. In certain cases, we do not fetch the right data : the updated data is not present in the result. What could be wrong ?
To explain in detail, we are using a custom Redmine plugin to call a remote web-service when an Issue is updated.
Issue.after_update do |obj|
logger.info "####REF OBJ :#{obj.inspect}"
logger.info "####REF DB :#{Issue.find(obj.id).inspect}"
client.updated_ticket_event_request(obj)
end
Our exact Redmine environment is Redmine version 2.6.1.stable, Ruby version 2.0.0-p648 (2015-12-16), Rails version 3.2.22.2. The remote web-service is a Java application that fetches the updated Issue using the Java Redmine API ( https://github.com/taskadapter/redmine-java-api ).
final Issue redmineIssue = fetchIssue(context, id, includes ); // RedmineManager.getIssueManager().getIssueById(id, includes)
final Ticket ticket = buildTicket(context, redmineIssue); // Building our own object
LOGGER.debug("Fetched ticket: "+ticket);
Now, in the followng logs, pay attention to the assignee identifier.
In Redmine logs :
####REF OBJ :#<Issue id: 5510, tracker_id: 5, project_id: 27, subject: "TEST08", description: "desc test 08", due_date: nil, category_id: nil, status_id: 1, assigned_to_id: 176, priority_id: 2, fixed_version_id: nil, author_id: 1, lock_version: 2, created_on: "2017-06-08 14:47:19", updated_on: "2017-06-08 14:48:21", start_date: nil, done_ratio: 0, estimated_hours: nil, parent_id: nil, root_id: 5510, lft: 10165, rgt: 10166, is_private: false, closed_on: nil, sprint_id: nil, position: 4764>
####REF DB :#<Issue id: 5510, tracker_id: 5, project_id: 27, subject: "TEST08", description: "desc test 08", due_date: nil, category_id: nil, status_id: 1, assigned_to_id: 176, priority_id: 2, fixed_version_id: nil, author_id: 1, lock_version: 2, created_on: "2017-06-08 14:47:19", updated_on: "2017-06-08 14:48:21", start_date: nil, done_ratio: 0, estimated_hours: nil, parent_id: nil, root_id: 5510, lft: 10165, rgt: 10166, is_private: false, closed_on: nil, sprint_id: nil, position: 4764>
In the Java application logs :
16:48:21.591 DEBUG Fetched ticket: [Ticket - Id = 5510 - Title = TEST08 - Description = desc test 08 - Assignees = PersonId{110} - Priority = 2 - Creator = 1 - Creation date = 2017-06-08T14:47:19Z]
Although in the Redmine database we do have assignee=176, through the web-service API we got assignee=110, which was the value before the update. Fetching the issue a second time, we get the correct value for the assigne.
The behaviour is not always reproducible. Most of the time, we do have the correct behaviour.
Upvotes: 0
Views: 183