Skip to content

Commit 81dcb5f

Browse files
authored
Merge pull request #506 from codex-team/move-timestamp-out-of-payload
imp(api): move timestamp out of event payload
2 parents 91ffc01 + 2666838 commit 81dcb5f

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

src/models/event.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
/**
2525
* @typedef {Object} EventPayload
2626
* @property {string} title - event title
27-
* @property {DateTime} timestamp - event datetime
2827
* @property {Number} level - event severity level
2928
* @property {EventBacktraceFrame[]} [backtrace] - event stack array from the latest call to the earliest
3029
* @property {Object} [get] - GET params
@@ -44,6 +43,7 @@
4443
* @property {String} groupHash - event's hash (catcherType + title + salt)
4544
* @property {User[]} visitedBy - array of users who visited this event
4645
* @property {EventPayload} payload - event's payload
46+
* @property {Number} timestamp - event's Unix timestamp
4747
*/
4848

4949
/**

src/models/eventsFactory.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const { ObjectID } = require('mongodb');
1919
* @property {String} _id — repetition's identifier
2020
* @property {String} groupHash - event's hash. Generates according to the rule described in EventSchema
2121
* @property {EventPayload} payload - repetition's payload
22+
* @property {Number} timestamp - repetition's Unix timestamp
2223
*/
2324

2425
/**
@@ -436,6 +437,7 @@ class EventsFactory extends Factory {
436437
_id: eventOriginal._id,
437438
payload: eventOriginal.payload,
438439
groupHash: eventOriginal.groupHash,
440+
timestamp: eventOriginal.timestamp,
439441
};
440442

441443
repetitions.push(firstRepetition);

src/typeDefs/event.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,6 @@ type EventPayload {
130130
"""
131131
type: String
132132
133-
"""
134-
Event timestamp
135-
"""
136-
timestamp: Float!
137-
138133
"""
139134
Event severity level
140135
"""
@@ -185,11 +180,6 @@ type EventPayload {
185180
Type representing Event payload. All fields can be omitted if there are no difference with the original
186181
"""
187182
type RepetitionPayload {
188-
"""
189-
Event timestamp. Can be empty if repetition has the same timestamp as original event
190-
"""
191-
timestamp: Float
192-
193183
"""
194184
Event title
195185
"""
@@ -269,6 +259,11 @@ type Repetition {
269259
Delta of the event's payload, stringified JSON
270260
"""
271261
delta: String
262+
263+
"""
264+
Event timestamp
265+
"""
266+
timestamp: Float!
272267
}
273268
274269
"""
@@ -323,6 +318,11 @@ type Event {
323318
"""
324319
payload: EventPayload!
325320
321+
"""
322+
Event timestamp
323+
"""
324+
timestamp: Float!
325+
326326
"""
327327
Release data
328328
"""

0 commit comments

Comments
 (0)