diff --git a/services/git-bridge/src/uk/ac/ic/wlgitbridge/application/SnapshotPushPostbackContents.java b/services/git-bridge/src/uk/ac/ic/wlgitbridge/application/SnapshotPushPostbackContents.java index babc295a31..13f65dd4ac 100644 --- a/services/git-bridge/src/uk/ac/ic/wlgitbridge/application/SnapshotPushPostbackContents.java +++ b/services/git-bridge/src/uk/ac/ic/wlgitbridge/application/SnapshotPushPostbackContents.java @@ -18,15 +18,17 @@ public class SnapshotPushPostbackContents implements JSONSource { private final WriteLatexDataSource writeLatexDataSource; private final String projectName; + private final String postbackKey; private final SnapshotPostExceptionBuilder snapshotPostExceptionBuilder; private int versionID; private SnapshotPostException exception; - public SnapshotPushPostbackContents(WriteLatexDataSource writeLatexDataSource, String projectName, String contents) { - this.projectName = projectName; + public SnapshotPushPostbackContents(WriteLatexDataSource writeLatexDataSource, String projectName, String postbackKey, String contents) { this.writeLatexDataSource = writeLatexDataSource; + this.projectName = projectName; + this.postbackKey = postbackKey; snapshotPostExceptionBuilder = new SnapshotPostExceptionBuilder(); fromJSON(new Gson().fromJson(contents, JsonElement.class)); } @@ -41,9 +43,9 @@ public class SnapshotPushPostbackContents implements JSONSource { public void processPostback() throws UnexpectedPostbackException { if (exception == null) { - writeLatexDataSource.postbackReceivedSuccessfully(projectName, versionID); + writeLatexDataSource.postbackReceivedSuccessfully(projectName, postbackKey, versionID); } else { - writeLatexDataSource.postbackReceivedWithException(projectName, exception); + writeLatexDataSource.postbackReceivedWithException(projectName, postbackKey, exception); } } diff --git a/services/git-bridge/src/uk/ac/ic/wlgitbridge/application/SnapshotPushPostbackHandler.java b/services/git-bridge/src/uk/ac/ic/wlgitbridge/application/SnapshotPushPostbackHandler.java index 58960b82ee..e903c58e43 100644 --- a/services/git-bridge/src/uk/ac/ic/wlgitbridge/application/SnapshotPushPostbackHandler.java +++ b/services/git-bridge/src/uk/ac/ic/wlgitbridge/application/SnapshotPushPostbackHandler.java @@ -28,7 +28,8 @@ public class SnapshotPushPostbackHandler extends AbstractHandler { String contents = getContentsOfReader(request.getReader()); String projectName = request.getRequestURI().split("/")[1]; System.out.println("Postback received for project: " + projectName); - SnapshotPushPostbackContents postbackContents = new SnapshotPushPostbackContents(writeLatexDataSource, projectName, contents); + String postbackKey = "postback"; + SnapshotPushPostbackContents postbackContents = new SnapshotPushPostbackContents(writeLatexDataSource, projectName, postbackKey, contents); try { postbackContents.processPostback(); } catch (UnexpectedPostbackException e) {