Skip to content
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

@Audit History not working expected. If two member changing state of object on same time, its showing wrong result. #716

Open
AkhileshManiTripathi opened this issue Mar 30, 2020 · 0 comments

Comments

@AkhileshManiTripathi
Copy link

Issue Details

@Audit History not working expected. If two member changing state of object on same time, its showing wrong result.

Type of Issue (check one with "X")

[ X] Bug Report


## Current Behavior
Suppose there are two system user USER1 and USER2, There is a member whose detail (**mFName**) is going to change by USER1 and USER2.
Initial Details of Member – 
fName -> **memberFName**


Modified Date | Modified By | Changed Value | Changed To | Previous Value
-- | -- | -- | -- | --
03/27/2020 06:16 AM | USER2 | mFName | mFName22 | **mFName2**
03/27/2020 06:15 AM | USER1 | mFName | mFName11 | **mFName1**
03/27/2020 06:15 AM | USER2 | mFName | mFName2 | mFName1
03/27/2020 06:14 AM | USER1 | mFName | mFName1 |  




## Expected Behavior

Modified Date | Modified By | Changed Value | Changed To | Previous Value
-- | -- | -- | -- | --
03/27/2020 06:16 AM | USER2 | mFName | mFName22 | **mFName11**
03/27/2020 06:15 AM | USER1 | mFName | mFName11 | **mFName2**
03/27/2020 06:15 AM | USER2 | mFName | mFName2 | mFName1
03/27/2020 06:14 AM | USER1 | mFName | mFName1 |  




## How to Reproduce the Issue
### Steps to Reproduce
1.	Create a member Add form.
2.	Add some member to db.
3.	In Member core use @Audit for all fields
4.	Login with 2 user in system and try to edit the member Details.



### Code Snippet
@Domain(value = "member", includeListeners = { ListenerType.persistence })
@Repo(alias = " member ", value = Database.rep_mongodb, cache = Cache.rep_device)
@Getter @Setter @ToString(callSuper = true)
public class Member extends AbstractEntity.IdLong {
	
	private static final long serialVersionUID = 1L;
	
	@Audit(MemberAudit.class)
	private String memberId;

	@Audit(MemberAudit.class)
	private String mFName;
	
}
Form – 
@Model
		@Getter
		@Setter
		@MapsTo.Type(Member.class)
		public static class AddMemberForm {
								
			@TextBox
			@Label("MemberId ")
			@Path
			private String memberId;
			
			@TextBox
			@Path
			private String mFName;	
			
			@Config(url = "/p/member/_new")
@Button(style = Button.Style.PRIMARY, type = Button.Type.submit)
			@Label(value = "Add Member")
			private String save;
			
			
		}



# Environment Details
**1.3.2.M2**


* **Browser:**
All
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants