Skip to content

Data inconsistencies with hooks #37

Open
pan261 opened this issue Mar 10, 2022 · 0 comments
Open

Data inconsistencies with hooks #37

pan261 opened this issue Mar 10, 2022 · 0 comments
Labels
invalid This doesn't seem right

Comments

@pan261
Copy link
Contributor

pan261 commented Mar 10, 2022

Two hooks, same operations, can return different values for createUserName and lastModifiedUserName.
From the logs, here are some examples:

Example 1

3/9/2022, 10:16:17 PM: info: server: Webhook (dm.version.added) callback received and verified
3/9/2022, 10:16:17 PM: info: server: "big.txt" has been added in gantry
Data:{
	"version": "1.0",
	"resourceUrn": "urn:adsk.wipprod:fs.file:vf.F0dB98FORRyF5FGLWYU11w?version=2",
	"hook": {
		"hookId": "dd011bb5-abd3-4c15-86c2-2ab5728c0d89",
		"tenant": "urn:adsk.wipprod:fs.folder:co.T0n0mYQeS16K0lq1VuuYVQ",
		"callbackUrl": "http://184c-172-56-12-126.ngrok.io/hook",
		"createdBy": "RJMJMMFZMRPN",
		"event": "dm.version.added",
		"createdDate": "2022-03-10T03:15:53.092+00:00",
		"lastUpdatedDate": "2022-03-10T03:15:53.092+00:00",
		"system": "data",
		"creatorType": "O2User",
		"status": "active",
		"scope": {
			"folder": "urn:adsk.wipprod:fs.folder:co.T0n0mYQeS16K0lq1VuuYVQ"
		},
		"autoReactivateHook": false,
		"urn": "urn:adsk.webhooks:events.hook:dd011bb5-abd3-4c15-86c2-2ab5728c0d89",
		"callbackWithEventPayloadOnly": false,
		"__self__": "/systems/data/events/dm.version.added/hooks/dd011bb5-abd3-4c15-86c2-2ab5728c0d89"
	},
	"payload": {
		"ext": "txt",
		"modifiedTime": "2022-03-10T03:16:03+0000",
		"creator": "RJMJMMFZMRPN",
		"lineageUrn": "urn:adsk.wipprod:dm.lineage:F0dB98FORRyF5FGLWYU11w",
		"sizeInBytes": 6,
		"hidden": false,
		"indexable": true,
		"source": "urn:adsk.wipprod:fs.file:vf.F0dB98FORRyF5FGLWYU11w?version=2",
		"mimeType": "application/txt",
		"version": "2",
		"user_info": {
			"id": "RJMJMMFZMRPN"
		},
		"name": "big.txt",
		"context": {
			"lineage": {
				"reserved": false,
				"reservedUserName": null,
				"reservedUserId": null,
				"reservedTime": null,
				"unreservedUserName": null,
				"unreservedUserId": null,
				"unreservedTime": null,
				"createUserId": "RJMJMMFZMRPN",
				"createTime": "2022-03-09T21:57:49+0000",
				"createUserName": "Kevin Pan",
				"lastModifiedUserId": "RJMJMMFZMRPN",
				"lastModifiedTime": "2022-03-10T03:16:03+0000",
				"lastModifiedUserName": "Kevin Pan"
			},
			"operation": "PostVersionedFiles"
		},
		"createdTime": "2022-03-10T03:16:03+0000",
		"modifiedBy": "RJMJMMFZMRPN",
		"state": "CONTENT_AVAILABLE",
		"parentFolderUrn": "urn:adsk.wipprod:fs.folder:co.IxiedfeBTOGg6NSIGQhXxQ",
		"ancestors": [
			{
				"name": "purdue2696",
				"urn": "urn:adsk.wipprod:fs.folder:co.o6HfBVfTQu24TMpbBfUM0Q"
			},
			{
				"name": "Fileshare Upload",
				"urn": "urn:adsk.wipprod:fs.folder:co.T0n0mYQeS16K0lq1VuuYVQ"
			},
			{
				"name": "Gantry",
				"urn": "urn:adsk.wipprod:fs.folder:co.IxiedfeBTOGg6NSIGQhXxQ"
			}
		],
		"project": "126877208",
		"tenant": "17313147",
		"custom-metadata": {
			"lineageTitle": "big.txt",
			"fileName": "big.txt"
		}
	},
	"timestamp": "3/9/2022, 10:16:17 PM"
}

Example 2

3/9/2022, 10:18:11 PM: info: server: Webhook (dm.version.added) callback received and verified
3/9/2022, 10:18:11 PM: info: server: "big.txt" has been added in gantry
Data:{
	"version": "1.0",
	"resourceUrn": "urn:adsk.wipprod:fs.file:vf.VpDCUlCWSVKgmJ-CwhZ-Qw?version=1",
	"hook": {
		"hookId": "9b92cfce-3d7f-41ad-a682-222d5dfbbfe3",
		"tenant": "urn:adsk.wipprod:fs.folder:co.T0n0mYQeS16K0lq1VuuYVQ",
		"callbackUrl": "http://cd7d-172-56-12-126.ngrok.io/hook",
		"createdBy": "RJMJMMFZMRPN",
		"event": "dm.version.added",
		"createdDate": "2022-03-10T03:17:40.424+00:00",
		"lastUpdatedDate": "2022-03-10T03:17:40.424+00:00",
		"system": "data",
		"creatorType": "O2User",
		"status": "active",
		"scope": {
			"folder": "urn:adsk.wipprod:fs.folder:co.T0n0mYQeS16K0lq1VuuYVQ"
		},
		"autoReactivateHook": false,
		"urn": "urn:adsk.webhooks:events.hook:9b92cfce-3d7f-41ad-a682-222d5dfbbfe3",
		"callbackWithEventPayloadOnly": false,
		"__self__": "/systems/data/events/dm.version.added/hooks/9b92cfce-3d7f-41ad-a682-222d5dfbbfe3"
	},
	"payload": {
		"ext": "txt",
		"modifiedTime": "2022-03-10T03:18:04+0000",
		"creator": "RJMJMMFZMRPN",
		"lineageUrn": "urn:adsk.wipprod:dm.lineage:VpDCUlCWSVKgmJ-CwhZ-Qw",
		"sizeInBytes": 6,
		"hidden": false,
		"indexable": true,
		"source": "urn:adsk.wipprod:fs.file:vf.VpDCUlCWSVKgmJ-CwhZ-Qw?version=1",
		"mimeType": "application/txt",
		"version": "1",
		"user_info": {
			"id": "RJMJMMFZMRPN"
		},
		"name": "big.txt",
		"context": {
			"lineage": {
				"reserved": false,
				"reservedUserName": null,
				"reservedUserId": null,
				"reservedTime": null,
				"unreservedUserName": null,
				"unreservedUserId": null,
				"unreservedTime": null,
				"createUserId": "RJMJMMFZMRPN",
				"createTime": "2022-03-10T03:18:04+0000",
				"createUserName": "pan261@purdue.edu",
				"lastModifiedUserId": "RJMJMMFZMRPN",
				"lastModifiedTime": "2022-03-10T03:18:04+0000",
				"lastModifiedUserName": "pan261@purdue.edu"
			},
			"operation": "PostVersionedFiles"
		},
		"createdTime": "2022-03-10T03:18:04+0000",
		"modifiedBy": "RJMJMMFZMRPN",
		"state": "CONTENT_AVAILABLE",
		"parentFolderUrn": "urn:adsk.wipprod:fs.folder:co.IxiedfeBTOGg6NSIGQhXxQ",
		"ancestors": [
			{
				"name": "purdue2696",
				"urn": "urn:adsk.wipprod:fs.folder:co.o6HfBVfTQu24TMpbBfUM0Q"
			},
			{
				"name": "Fileshare Upload",
				"urn": "urn:adsk.wipprod:fs.folder:co.T0n0mYQeS16K0lq1VuuYVQ"
			},
			{
				"name": "Gantry",
				"urn": "urn:adsk.wipprod:fs.folder:co.IxiedfeBTOGg6NSIGQhXxQ"
			}
		],
		"project": "126877208",
		"tenant": "17313147",
		"custom-metadata": {
			"lineageTitle": "big.txt",
			"fileName": "big.txt"
		}
	},
	"timestamp": "3/9/2022, 10:18:11 PM"
}

Example 3

3/9/2022, 10:32:52 PM: info: server: Webhook (dm.version.added) callback received and verified
3/9/2022, 10:32:52 PM: info: server: "big.txt" has been added in lathe
Data:{
	"version": "1.0",
	"resourceUrn": "urn:adsk.wipprod:fs.file:vf.5UXJoOJpRAmsyXiw7KowLg?version=2",
	"hook": {
		"hookId": "9b92cfce-3d7f-41ad-a682-222d5dfbbfe3",
		"tenant": "urn:adsk.wipprod:fs.folder:co.T0n0mYQeS16K0lq1VuuYVQ",
		"callbackUrl": "http://cd7d-172-56-12-126.ngrok.io/hook",
		"createdBy": "RJMJMMFZMRPN",
		"event": "dm.version.added",
		"createdDate": "2022-03-10T03:17:40.424+00:00",
		"lastUpdatedDate": "2022-03-10T03:17:40.424+00:00",
		"system": "data",
		"creatorType": "O2User",
		"status": "active",
		"scope": {
			"folder": "urn:adsk.wipprod:fs.folder:co.T0n0mYQeS16K0lq1VuuYVQ"
		},
		"autoReactivateHook": false,
		"urn": "urn:adsk.webhooks:events.hook:9b92cfce-3d7f-41ad-a682-222d5dfbbfe3",
		"callbackWithEventPayloadOnly": false,
		"__self__": "/systems/data/events/dm.version.added/hooks/9b92cfce-3d7f-41ad-a682-222d5dfbbfe3"
	},
	"payload": {
		"ext": "txt",
		"modifiedTime": "2022-03-10T03:32:48+0000",
		"creator": "RJMJMMFZMRPN",
		"lineageUrn": "urn:adsk.wipprod:dm.lineage:5UXJoOJpRAmsyXiw7KowLg",
		"sizeInBytes": 6,
		"hidden": false,
		"indexable": true,
		"source": "urn:adsk.wipprod:fs.file:vf.5UXJoOJpRAmsyXiw7KowLg?version=2",
		"mimeType": "application/txt",
		"version": "2",
		"user_info": {
			"id": "RJMJMMFZMRPN"
		},
		"name": "big.txt",
		"context": {
			"lineage": {
				"reserved": false,
				"reservedUserName": null,
				"reservedUserId": null,
				"reservedTime": null,
				"unreservedUserName": null,
				"unreservedUserId": null,
				"unreservedTime": null,
				"createUserId": "RJMJMMFZMRPN",
				"createTime": "2022-03-10T03:21:05+0000",
				"createUserName": "Kevin Pan",
				"lastModifiedUserId": "RJMJMMFZMRPN",
				"lastModifiedTime": "2022-03-10T03:32:48+0000",
				"lastModifiedUserName": "pan261@purdue.edu"
			},
			"operation": "PostVersionedFiles"
		},
		"createdTime": "2022-03-10T03:32:48+0000",
		"modifiedBy": "RJMJMMFZMRPN",
		"state": "CONTENT_AVAILABLE",
		"parentFolderUrn": "urn:adsk.wipprod:fs.folder:co.FDWCeyBGQX2rv8xSNWo5lg",
		"ancestors": [
			{
				"name": "purdue2696",
				"urn": "urn:adsk.wipprod:fs.folder:co.o6HfBVfTQu24TMpbBfUM0Q"
			},
			{
				"name": "Fileshare Upload",
				"urn": "urn:adsk.wipprod:fs.folder:co.T0n0mYQeS16K0lq1VuuYVQ"
			},
			{
				"name": "Lathe",
				"urn": "urn:adsk.wipprod:fs.folder:co.FDWCeyBGQX2rv8xSNWo5lg"
			}
		],
		"project": "126877208",
		"tenant": "17313147",
		"custom-metadata": {
			"lineageTitle": "big.txt",
			"fileName": "big.txt"
		}
	},
	"timestamp": "3/9/2022, 10:32:52 PM"
}

Note how in all three cases, the operation (PostVersionedFiles was the same), however, in the first case, both createUserName and lastModifiedUserName were my email (pan261@purdue.edu), in the second case, both of the fields were my name (Kevin Pan), and in the third case, createUserName was my name and lastModifiedUserName was my email.

This should not be a problem as this field is only used to identify users, and there are no breaking changes, so I can't think of any issues we might run into as of now.

@pan261 pan261 added the invalid This doesn't seem right label Mar 10, 2022
Sign in to join this conversation on GitHub.
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant