-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add Events for personal feed #379
Conversation
type Event @entity { | ||
id: ID! | ||
type: EventType! | ||
data: String! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this data field ? why it is needed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That include some JSON data Alchemy might need. @jellegerbrandy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can see what goes into the data field in the various addXXXEvent functions above. we need to tell the users what happened for each event, like the amount staked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that cannot be analyzed from the event it self ? in the client side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/domain/event.ts
Outdated
addEvent( | ||
'NewDAO', | ||
avatar.toHex(), | ||
'{ "address": "' + avatar.toHex() + '", "name": "' + daoName + '" }', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is that ?
why it is hard coded here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s just the data object Alchemy needs for this event type...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on first glance it looks not so elegant solution. is that can be avoided ? @jellegerbrandy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need the Dao avatar address here since we already have that in its own field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tibet is right: the avatar is not strictly needed (although neither does it hurt to have it :-))
I do not really understand @orenyodfat's objection.
Events have a data
attribute that is a string. This string happends to be a JSON structure, which is useful when we want to reprseent the event. This does not seem particularly unelegant to me as a pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this data need to be searchable and indexed?
It looks too specific and duplicate the field we have on the entity it self .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no it does not, that is why it is in a text field and not in its own separate field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, is that cannot be analyzed from the event it self ?
…On Thu, 31 Oct 2019 at 18:47 Tibet Sprague ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/domain/event.ts
<#379 (comment)>:
> @@ -0,0 +1,125 @@
+import { Address, BigInt, ByteArray, Bytes, crypto } from ***@***.***/graph-ts';
+import { Event, Proposal, ReputationHolder } from '../types/schema';
+import { concat } from '../utils';
+
+export function addNewDAOEvent(avatar: Address, daoName: string, timestamp: BigInt): void {
+ addEvent(
+ 'NewDAO',
+ avatar.toHex(),
+ '{ "address": "' + avatar.toHex() + '", "name": "' + daoName + '" }',
I think we don't need the Dao avatar address here since we already have
that in its own field.
------------------------------
In src/domain/schema.graphql
<#379 (comment)>:
> @@ -188,3 +198,13 @@ type ContractInfo @entity {
version: String!
address: Bytes!
}
+
+type Event @entity {
+ id: ID!
+ type: EventType!
+ data: String!
you can see what goes into the data field in the various addXXXEvent
functions above. we need to tell the users what happened for each event,
like the amount staked.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#379?email_source=notifications&email_token=ABNXPHQAWAIL4BJYOLUJGSDQRMD3BA5CNFSM4JGV4CN2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCJ5KF6I#discussion_r341249028>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNXPHRBSFKPJBNHAJ65E43QRMD3BANCNFSM4JGV4CNQ>
.
|
Does this data need to be searchable and indexed?
It looks too specific and duplicate the field we have on the entity it
self .
…On Mon, 4 Nov 2019 at 17:26 Jelle ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/domain/event.ts
<#379 (comment)>:
> @@ -0,0 +1,125 @@
+import { Address, BigInt, ByteArray, Bytes, crypto } from ***@***.***/graph-ts';
+import { Event, Proposal, ReputationHolder } from '../types/schema';
+import { concat } from '../utils';
+
+export function addNewDAOEvent(avatar: Address, daoName: string, timestamp: BigInt): void {
+ addEvent(
+ 'NewDAO',
+ avatar.toHex(),
+ '{ "address": "' + avatar.toHex() + '", "name": "' + daoName + '" }',
tibet is right: the avatar is not strictly needed (although neither does
it hurt to have it :-))
I do not really understand @orenyodfat <https://github.com/orenyodfat>'s
objection.
Events have a data attribute that is a string. This string happends to be
a JSON structure, which is useful when we want to reprseent the event. This
does not seem particularly unelegant to me as a pattern
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#379?email_source=notifications&email_token=ABNXPHR6OVEH2ZB26CKRS3LQSA5LDA5CNFSM4JGV4CN2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCKF3T3A#discussion_r342108181>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNXPHV4DU3MUOUGDYPNEWLQSA5LDANCNFSM4JGV4CNQ>
.
|
Fix #377.