diff --git a/.stickler.yml b/.stickler.yml index 507a4ec039..08d1ec34eb 100644 --- a/.stickler.yml +++ b/.stickler.yml @@ -3,8 +3,9 @@ linters: fixer: false shellcheck: shell: bash - eslint: - config: './client/react-native/.eslintrc' + # eslint: + # config: './client/react-native/.eslintrc' + # install_plugins: true swiftlint: { } files: ignore: diff --git a/client/react-native/common/components/Library/Header.js b/client/react-native/common/components/Library/Header.js index d3cb8c30ab..b2a6b5feba 100644 --- a/client/react-native/common/components/Library/Header.js +++ b/client/react-native/common/components/Library/Header.js @@ -74,7 +74,6 @@ export default class Header extends PureComponent { left large color={colorText} - ellipsis justify={backBtn ? 'center' : 'start'} middle size={5} diff --git a/client/react-native/common/components/Library/ListItem.js b/client/react-native/common/components/Library/ListItem.js index 00dbc85e4a..a4867e9055 100644 --- a/client/react-native/common/components/Library/ListItem.js +++ b/client/react-native/common/components/Library/ListItem.js @@ -33,10 +33,10 @@ export default class ListItem extends PureComponent { justify='center' style={[marginLeft]} > - + {title} - + {subtitle} diff --git a/client/react-native/common/components/Library/Menu.js b/client/react-native/common/components/Library/Menu.js index c64ab16c5b..61a69abeea 100644 --- a/client/react-native/common/components/Library/Menu.js +++ b/client/react-native/common/components/Library/Menu.js @@ -23,11 +23,11 @@ export default class Menu extends Component { justify='between' style={[paddingLeft, { height: 42 }]} > - + {title} {description && ( - + {description} )} @@ -113,7 +113,6 @@ export default class Menu extends Component { color={color || colors.textBlack} align='center' bold={boldLeft ? true : null} - ellipsis > {title} diff --git a/client/react-native/common/components/Library/Text.js b/client/react-native/common/components/Library/Text.js index f027ea3214..878115c9f7 100644 --- a/client/react-native/common/components/Library/Text.js +++ b/client/react-native/common/components/Library/Text.js @@ -216,10 +216,23 @@ const getMargin = ( } } -const getHeight = props => - StyleSheet.create({ - height: { height: props.height, lineHeight: props.height }, +const getHeight = props => { + let { multiline, height, lineHeight } = props + + if (!height && !lineHeight) { + return null + } else if (!lineHeight && typeof multiline === 'number') { + lineHeight = height / multiline + } else if (!lineHeight && !multiline) { + lineHeight = height + } + return StyleSheet.create({ + height: { + height, + lineHeight, + }, }).height +} export class BackgroundText extends PureComponent { static styles = {} @@ -330,7 +343,8 @@ export class ForegroundText extends PureComponent { } render () { - const { icon, input, children, ellipsis, onSubmit } = this.props + const { icon, input, children, multiline, onSubmit } = this.props + const numberOfLines = typeof multiline === 'number' ? multiline : undefined const styles = ForegroundText.getStyles(this.props) return ( @@ -347,13 +361,15 @@ export class ForegroundText extends PureComponent { placeholder={children || input.placeholder} placeholderTextColor={colors.subtleGrey} onSubmitEditing={onSubmit} + multiline={!!multiline} + numberOfLines={numberOfLines} /> ) : ( {children} diff --git a/client/react-native/common/components/Screens/Chats/Detail.js b/client/react-native/common/components/Screens/Chats/Detail.js index 51f56f1fc7..bfb7221911 100644 --- a/client/react-native/common/components/Screens/Chats/Detail.js +++ b/client/react-native/common/components/Screens/Chats/Detail.js @@ -1,85 +1,65 @@ -import React, { PureComponent } from 'react' -import { FlatList } from 'react-native' -import { colors } from '../../../constants' -import { queries, mutations, subscriptions } from '../../../graphql' +/* eslint-disable */ +import { ActivityIndicator, FlatList } from 'react-native' +import React, { Fragment, PureComponent } from 'react' + import { QueryReducer } from '../../../relay' import { Text, Flex, Screen, Header } from '../../Library' +import { colors } from '../../../constants' +import { fragments, mutations, queries, subscriptions } from '../../../graphql' +import { merge } from '../../../helpers' import { paddingHorizontal, shadow } from '../../../styles' import { conversation as utils } from '../../../utils' -const Message = props => { +const Message = fragments.Event(props => { const conversation = props.navigation.getParam('conversation') const contactId = props.data.senderId const isMyself = conversation.members.find(m => m.contactId === contactId).contact.status === 42 return ( - - { - JSON.parse(String.fromCharCode.apply(null, props.data.attributes)) - .message.text - } - - ) -} - -class List extends PureComponent { - onEndReached = () => {} - - componentDidMount () { - const { id } = this.props.navigation.getParam('conversation') - this.subscriber = subscriptions.conversationNewMessage.subscribe({ - updater: (store, data) => { - if (data.conversationId === id) { - this.props.retry && this.props.retry() + + + {new Date(props.data.createdAt).toTimeString()} + + + { + JSON.parse(String.fromCharCode.apply(null, props.data.attributes)) + .message.text } - }, - }) - } - - componentWillUnmount () { - this.subscriber.unsubscribe() - } - - render () { - const { data, loading } = this.props - return ( - (this.ref = ref)} - style={[{ paddingTop: 54 }, paddingHorizontal]} - data={(data.EventList || []) - .filter(event => event.kind === 302) // CONVERSATION_NEW_MESSAGE - .reverse()} - inverted - refreshing={loading} - onEndReached={this.onEndReached} - renderItem={data => ( - - )} - /> - ) - } -} + + + ) +}) class Input extends PureComponent { state = { @@ -91,33 +71,30 @@ class Input extends PureComponent { this.setState({ input: '' }, async () => { try { const conversation = this.props.navigation.getParam('conversation') - await mutations.conversationAddMessage.commit({ + await mutations.conversationAddMessage({ conversation: { id: conversation.id, - title: '', - topic: '', }, message: { text: input, }, }) - this.props.retry && this.props.retry() } catch (err) { console.error(err) } }) } - render () { + render() { return ( this.setState({ input }), @@ -133,6 +110,71 @@ class Input extends PureComponent { } } +const List = fragments.EventList( + class List extends PureComponent { + onEndReached = () => { + if (!this.props.relay.hasMore() || this.props.relay.isLoading()) { + return + } + this.props.relay.loadMore(5, console.error) + } + + componentDidMount() { + const conversation = this.props.navigation.getParam('conversation') + this.subscriber = subscriptions.conversationNewMessage.subscribe( + conversation + ) + } + + componentWillUnmount() { + this.subscriber.unsubscribe() + } + + render() { + const { data, loading } = this.props + const edges = (data && data.EventList && data.EventList.edges) || [] + return ( + + (this.ref = ref)} + style={[{ paddingTop: 54 }, paddingHorizontal]} + data={edges} + inverted + refreshing={loading} + onEndReached={this.onEndReached} + renderItem={({ item: { node, cursor }, separators }) => ( + + )} + /> + + + + + + + ) + } + } +) + export default class Detail extends PureComponent { static navigationOptions = ({ navigation }) => ({ header: ( @@ -140,7 +182,7 @@ export default class Detail extends PureComponent { navigation={navigation} title={utils.getTitle(navigation.getParam('conversation'))} backBtn - rightBtnIcon='settings' + rightBtnIcon="settings" onPressRightBtn={() => navigation.push('chats/settings', { conversation: navigation.getParam('conversation'), @@ -150,54 +192,39 @@ export default class Detail extends PureComponent { ), }) - render () { + render() { const conversation = this.props.navigation.getParam('conversation') return ( - {(state, retry) => ( - - - - - - - - - )} + {(state, retry) => { + switch (state.type) { + default: + case state.loading: + return + case state.success: + return ( + + ) + case state.error: + return null + } + }} ) diff --git a/client/react-native/common/components/Screens/Contacts/Add/Request.js b/client/react-native/common/components/Screens/Contacts/Add/Request.js index d9c60dfc1a..8f01e476d0 100644 --- a/client/react-native/common/components/Screens/Contacts/Add/Request.js +++ b/client/react-native/common/components/Screens/Contacts/Add/Request.js @@ -66,13 +66,7 @@ const Item = fragments.Contact( }} /> - + {overrideDisplayName || displayName} diff --git a/client/react-native/common/components/Screens/Contacts/List.js b/client/react-native/common/components/Screens/Contacts/List.js index 59395b5648..cfa2df626a 100644 --- a/client/react-native/common/components/Screens/Contacts/List.js +++ b/client/react-native/common/components/Screens/Contacts/List.js @@ -25,10 +25,10 @@ const Item = fragments.Contact( /> - + {overrideDisplayName || displayName} - + {displayStatus} diff --git a/client/react-native/common/components/Screens/Settings/Devtools/EventList.js b/client/react-native/common/components/Screens/Settings/Devtools/EventList.js index da8f100652..2a91bfdf59 100644 --- a/client/react-native/common/components/Screens/Settings/Devtools/EventList.js +++ b/client/react-native/common/components/Screens/Settings/Devtools/EventList.js @@ -1,113 +1,122 @@ +import { + ActivityIndicator, + FlatList, + Text, + TouchableOpacity, +} from 'react-native' import React, { PureComponent } from 'react' -import { TouchableOpacity, FlatList, Text } from 'react-native' + import { Flex, Header, Screen, Separator } from '../../../Library' -import { queries } from '../../../../graphql' import { QueryReducer } from '../../../../relay' import { colors } from '../../../../constants' import { marginLeft, padding } from '../../../../styles' +import { queries, fragments } from '../../../../graphql' -class List extends PureComponent { - onEndReached = () => {} +const Item = fragments.Event(({ data, navigation }) => ( + { + navigation.push('devtools/eventdetails', { details: data }) + }} + style={[ + { + backgroundColor: colors.white, + height: 72, + }, + padding, + ]} + > + + + + Kind + {' ' + data.kind} + + + ID + {' ' + data.id} + + + Created + {' ' + data.createdAt} + + + + +)) - state = { - search: '', - } +const List = fragments.EventList( + class List extends PureComponent { + onEndReached = () => {} - searchHandler = search => this.setState({ search }) + state = { + search: '', + } - filter = EventList => { - const { search } = this.state - if (search === '') { - return EventList - } else { - return EventList.filter( - entry => - entry.id.toLowerCase().indexOf(search.toLowerCase()) > -1 || - entry.kind.toLowerCase().indexOf(search.toLowerCase()) > -1 || - entry.createdAt.toLowerCase().indexOf(search.toLowerCase()) > -1 - ) + searchHandler = search => this.setState({ search }) + + filter = EventList => { + const { search } = this.state + if (search === '') { + return EventList + } else { + return EventList.filter( + entry => + entry.id.toLowerCase().indexOf(search.toLowerCase()) > -1 || + entry.kind.toLowerCase().indexOf(search.toLowerCase()) > -1 || + entry.createdAt.toLowerCase().indexOf(search.toLowerCase()) > -1 + ) + } } - } - componentDidMount () { - this.props.navigation.setParams({ searchHandler: this.searchHandler }) - this.props.navigation.setParams({ - searchHandler: this.searchHandler, - retry: () => this.props.retry && this.props.retry(), - }) - } + componentDidMount () { + this.props.navigation.setParams({ searchHandler: this.searchHandler }) + this.props.navigation.setParams({ + searchHandler: this.searchHandler, + retry: () => this.props.retry && this.props.retry(), + }) + } - componentWillUnmount () {} + componentWillUnmount () {} - render () { - const { data, retry, loading, navigation } = this.props - return ( - ( - - )} - onEndReached={this.onEndReached} - refreshing={loading} - onRefresh={retry} - navigation={navigation} - renderItem={data => ( - { - console.log(data.item) - navigation.push('devtools/eventdetails', { details: data.item }) - }} - style={[ - { - backgroundColor: colors.white, - height: 72, - }, - padding, - ]} - > - - - - Kind - {' ' + data.item.kind} - - - ID - {' ' + data.item.id} - - - Created - {' ' + data.item.createdAt} - - - - - )} - /> - ) + render () { + const { data, retry, loading, navigation } = this.props + return ( + ( + + )} + onEndReached={this.onEndReached} + refreshing={loading} + onRefresh={retry} + navigation={navigation} + renderItem={data => ( + + )} + /> + ) + } } -} - +) export default class EventList extends PureComponent { static navigationOptions = ({ navigation }) => ({ header: ( @@ -125,17 +134,33 @@ export default class EventList extends PureComponent { const { navigation } = this.props return ( - - {(state, retry) => ( - - - - )} + + {(state, retry) => { + console.log(state) + switch (state.type) { + default: + case state.loading: + return ( + + + + ) + case state.success: + return ( + + ) + case state.error: + return null + } + }} ) diff --git a/client/react-native/common/graphql/fragments/ContactList.js b/client/react-native/common/graphql/fragments/ContactList.js index 50b5212e9f..5478d793a5 100644 --- a/client/react-native/common/graphql/fragments/ContactList.js +++ b/client/react-native/common/graphql/fragments/ContactList.js @@ -1,7 +1,9 @@ import { graphql, createPaginationContainer } from 'react-relay' -import * as queries from '../queries' + import { contact } from '../../utils' +import { merge } from '../../helpers' import { updater } from '../../relay' +import * as queries from '../queries' const ContactList = component => createPaginationContainer( @@ -59,11 +61,11 @@ ContactList.defaultArguments = { orderBy: '', orderDesc: false, } -ContactList.updater = (store, args) => - updater(store).connection('ContactList_ContactList', { - ...ContactList.defaultArguments, - ...(args || {}), - }) +ContactList.updater = (store, args = {}) => + updater(store).connection( + 'ContactList_ContactList', + merge([ContactList.defaultArguments, args]) + ) ContactList.Received = component => createPaginationContainer( @@ -124,11 +126,11 @@ ContactList.Received.defaultArguments = { orderBy: '', orderDesc: false, } -ContactList.Received.updater = (store, args) => - updater(store).connection('ContactListReceived_ContactList', { - ...ContactList.Received.defaultArguments, - ...(args || {}), - }) +ContactList.Received.updater = (store, args = {}) => + updater(store).connection( + 'ContactListReceived_ContactList', + merge([ContactList.Received.defaultArguments, args]) + ) ContactList.Sent = component => createPaginationContainer( @@ -189,10 +191,10 @@ ContactList.Sent.defaultArguments = { orderBy: '', orderDesc: false, } -ContactList.Sent.updater = (store, args) => - updater(store).connection('ContactListSent_ContactList', { - ...ContactList.Sent.defaultArguments, - ...(args || {}), - }) +ContactList.Sent.updater = (store, args = {}) => + updater(store).connection( + 'ContactListSent_ContactList', + merge([ContactList.Sent.defaultArguments, args]) + ) export default ContactList diff --git a/client/react-native/common/graphql/fragments/ConversationList.js b/client/react-native/common/graphql/fragments/ConversationList.js index 4f96422a7a..d2e46325b1 100644 --- a/client/react-native/common/graphql/fragments/ConversationList.js +++ b/client/react-native/common/graphql/fragments/ConversationList.js @@ -1,8 +1,11 @@ import { graphql, createPaginationContainer } from 'react-relay' -import { ConversationList } from '../queries' +import { conversation } from '../../utils' +import { merge } from '../../helpers' +import { queries } from '../../graphql' +import { updater } from '../../relay' -export default component => +const ConversationList = component => createPaginationContainer( component, graphql` @@ -50,6 +53,18 @@ export default component => getVariables (props, { count, cursor }, fragmentVariables) { return { count, cursor } }, - query: ConversationList, + query: queries.ConversationList, } ) +ConversationList.defaultArguments = { + filter: conversation.default, + orderBy: '', + orederDesc: false, +} +ConversationList.updater = (store, args = {}) => + updater(store).connection( + 'ConversationList_ConversationList', + merge([ConversationList.defaultArguments, args]) + ) + +export default ConversationList diff --git a/client/react-native/common/graphql/fragments/Event.js b/client/react-native/common/graphql/fragments/Event.js new file mode 100644 index 0000000000..7837cbb4af --- /dev/null +++ b/client/react-native/common/graphql/fragments/Event.js @@ -0,0 +1,25 @@ +import { graphql, createFragmentContainer } from 'react-relay' + +export default component => + createFragmentContainer( + component, + graphql` + fragment Event on BertyP2pEvent { + id + senderId + createdAt + updatedAt + deletedAt + sentAt + receivedAt + ackedAt + direction + senderApiVersion + receiverApiVersion + receiverId + kind + attributes + conversationId + } + ` + ) diff --git a/client/react-native/common/graphql/fragments/EventList.js b/client/react-native/common/graphql/fragments/EventList.js new file mode 100644 index 0000000000..6457e77b8d --- /dev/null +++ b/client/react-native/common/graphql/fragments/EventList.js @@ -0,0 +1,76 @@ +import { graphql, createPaginationContainer } from 'react-relay' + +import { event } from '../../utils' +import { merge } from '../../helpers' +import { queries } from '../../graphql' +import { updater } from '../../relay' + +const EventList = component => + createPaginationContainer( + component, + graphql` + fragment EventList on Query + @argumentDefinitions( + filter: { type: BertyP2pEventInput } + count: { type: "Int32" } + cursor: { type: "String" } + ) { + EventList( + filter: $filter + first: $count + after: $cursor + orderBy: "created_at" + orderDesc: true + ) @connection(key: "EventList_EventList") { + edges { + cursor + node { + id + ...Event + } + } + pageInfo { + count + hasNextPage + hasPreviousPage + endCursor + startCursor + } + } + } + `, + { + direction: 'forward', + getConnectionFromProps (props) { + return props.data.EventList + }, + getFragmentVariables (prevVars, totalCount) { + return { + ...prevVars, + count: totalCount, + } + }, + getVariables (props, { count, cursor }, fragmentVariables) { + return { + ...fragmentVariables, + count, + cursor: + props.data.EventList.edges[props.data.EventList.edges.length - 1] + .cursor, + } + }, + query: queries.EventList, + } + ) +EventList.defaultArguments = { + filter: event.default, + orderBy: 'created_at', + orderDesc: true, +} +EventList.updater = (store, args = {}) => + updater(store).connection( + 'EventList_EventList', + merge([EventList.defaultArguments, args]) + ) + +export default EventList diff --git a/client/react-native/common/graphql/fragments/index.js b/client/react-native/common/graphql/fragments/index.js index 9f0b4dc645..1eb520bc9f 100644 --- a/client/react-native/common/graphql/fragments/index.js +++ b/client/react-native/common/graphql/fragments/index.js @@ -2,3 +2,5 @@ export Conversation from './Conversation' export ConversationList from './ConversationList' export Contact from './Contact' export ContactList from './ContactList' +export Event from './Event' +export EventList from './EventList' diff --git a/client/react-native/common/graphql/mutations/ContactAcceptRequest.js b/client/react-native/common/graphql/mutations/ContactAcceptRequest.js index 6e558df1d4..dcce388cff 100644 --- a/client/react-native/common/graphql/mutations/ContactAcceptRequest.js +++ b/client/react-native/common/graphql/mutations/ContactAcceptRequest.js @@ -1,7 +1,9 @@ import { graphql } from 'react-relay' + import { commit } from '../../relay' import { contact } from '../../utils' import { fragments } from '../../graphql' +import { merge } from '../../helpers' const ContactAcceptRequestMutation = graphql` mutation ContactAcceptRequestMutation( @@ -46,11 +48,7 @@ export default (input, configs) => commit( ContactAcceptRequestMutation, 'ContactAcceptRequest', - { - ...contact.default, - ...input, - }, - + merge([contact.default, input]), { updater: (store, data) => fragments.ContactList.Received.updater(store).delete( diff --git a/client/react-native/common/graphql/mutations/ConversationAddMessage.js b/client/react-native/common/graphql/mutations/ConversationAddMessage.js index 7cb3db2086..1a86e51681 100644 --- a/client/react-native/common/graphql/mutations/ConversationAddMessage.js +++ b/client/react-native/common/graphql/mutations/ConversationAddMessage.js @@ -1,5 +1,9 @@ import { graphql } from 'react-relay' + import { commit } from '../../relay' +import { conversation } from '../../utils' +import { fragments } from '../../graphql' +import { merge } from '../../helpers' const ConversationAddMessageMutation = graphql` mutation ConversationAddMessageMutation( @@ -26,12 +30,25 @@ const ConversationAddMessageMutation = graphql` } ` -export default { - commit: (input, configs) => - commit( - ConversationAddMessageMutation, - 'ConversationAddMessage', +export default (input, configs) => + commit( + ConversationAddMessageMutation, + 'ConversationAddMessage', + merge([ + { conversation: conversation.default, message: { text: '' } }, input, - configs - ), -} + ]), + { + updater: (store, data) => { + fragments.EventList.updater(store, { + filter: { + conversationId: data.ConversationAddMessage.conversationId, + kind: data.ConversationAddMessage.kind, + }, + }) + .add('EventEdge', data.ConversationAddMessage.id) + .before() + }, + ...configs, + } + ) diff --git a/client/react-native/common/graphql/queries/ContactList.js b/client/react-native/common/graphql/queries/ContactList.js index 958e129dc0..da3477a0d1 100644 --- a/client/react-native/common/graphql/queries/ContactList.js +++ b/client/react-native/common/graphql/queries/ContactList.js @@ -1,4 +1,6 @@ import { graphql } from 'react-relay' +import { contact } from '../../utils' +import { merge } from '../../helpers' const ContactList = graphql` query ContactListQuery( @@ -22,14 +24,12 @@ ContactList.Received = graphql` ` ContactList.Received.defaultVariables = { - filter: { - id: '', - status: 4, - displayName: '', - displayStatus: '', - overrideDisplayName: '', - overrideDisplayStatus: '', - }, + filter: merge([ + contact.default, + { + status: 4, + }, + ]), count: 10, cursor: '', } @@ -46,14 +46,7 @@ ContactList.Sent = graphql` ` ContactList.Sent.defaultVariables = { - filter: { - id: '', - status: 3, - displayName: '', - displayStatus: '', - overrideDisplayName: '', - overrideDisplayStatus: '', - }, + filter: merge([contact.default, { status: 3 }]), count: 10, cursor: '', } diff --git a/client/react-native/common/graphql/queries/EventList.js b/client/react-native/common/graphql/queries/EventList.js index d9f1a0cc56..7fc194057f 100644 --- a/client/react-native/common/graphql/queries/EventList.js +++ b/client/react-native/common/graphql/queries/EventList.js @@ -1,23 +1,20 @@ import { graphql } from 'react-relay' +import { event } from '../../utils' -export default graphql` - query EventListQuery($filter: BertyP2pEventInput) { - EventList(filter: $filter) { - id - senderId - createdAt - updatedAt - deletedAt - sentAt - receivedAt - ackedAt - direction - senderApiVersion - receiverApiVersion - receiverId - kind - attributes - conversationId - } +const EventList = graphql` + query EventListQuery( + $filter: BertyP2pEventInput + $count: Int32 + $cursor: String + ) { + ...EventList @arguments(filter: $filter, count: $count, cursor: $cursor) } ` + +EventList.defaultVariables = { + filter: event.default, + count: 5, + cursor: new Date(Date.now()).toISOString(), +} + +export default EventList diff --git a/client/react-native/common/graphql/queries/index.js b/client/react-native/common/graphql/queries/index.js index 4c18c20593..3f2d4cb68b 100644 --- a/client/react-native/common/graphql/queries/index.js +++ b/client/react-native/common/graphql/queries/index.js @@ -3,3 +3,4 @@ export ContactList from './ContactList' export Contact from './Contact' export GetDeviceInfos from './DeviceInfos' export AppVersion from './AppVersion' +export EventList from './EventList' diff --git a/client/react-native/common/graphql/subscriptions/ConversationNewMessage.js b/client/react-native/common/graphql/subscriptions/ConversationNewMessage.js index 21d6f9941e..84b31a098a 100644 --- a/client/react-native/common/graphql/subscriptions/ConversationNewMessage.js +++ b/client/react-native/common/graphql/subscriptions/ConversationNewMessage.js @@ -1,30 +1,25 @@ +import { fragments } from '..' import EventStream from './EventStream' export default { ...EventStream, - subscribe: ({ iterator, updater }) => + subscribe: conversation => EventStream.subscribe({ - iterator: - iterator && - function * () { - try { - while (true) { - const response = yield - if (response.EventStream.kind === 302) { - iterator.next(response.EventStream) - } - } - } catch (error) { - iterator.error(error) - } - iterator.return() - }, - updater: - updater && - ((store, data) => { - if (data.EventStream.kind === 302) { - return updater(store, data.EventStream) - } - }), + updater: (store, data) => { + console.log('RECEIVED_EVENT') + if ( + data.EventStream.kind === 302 && + data.EventStream.conversationId === conversation.id + ) { + fragments.EventList.updater(store, { + filter: { + conversationId: data.EventStream.conversationId, + kind: data.EventStream.kind, + }, + }) + .add('EventEdge', data.EventStream.id) + .before(data.EventStream.createdAt) + } + }, }), } diff --git a/client/react-native/common/helpers/index.js b/client/react-native/common/helpers/index.js new file mode 100644 index 0000000000..089a82ad03 --- /dev/null +++ b/client/react-native/common/helpers/index.js @@ -0,0 +1 @@ +export merge from './merge' diff --git a/client/react-native/common/helpers/merge.js b/client/react-native/common/helpers/merge.js new file mode 100644 index 0000000000..449ed75fb4 --- /dev/null +++ b/client/react-native/common/helpers/merge.js @@ -0,0 +1,4 @@ +import deepmerge from 'deepmerge' + +export default objects => + deepmerge.all(objects, { arrayMerge: (dst, src) => src }) diff --git a/client/react-native/common/relay/commit.js b/client/react-native/common/relay/commit.js index 5bab2bb999..4eda1c3f8c 100644 --- a/client/react-native/common/relay/commit.js +++ b/client/react-native/common/relay/commit.js @@ -11,6 +11,10 @@ export default (mutation, clientMutationId, input = {}, configs) => { reject(errs) return } + if (res && res.errors) { + reject(res.erros) + return + } resolve(res) }, onError: reject, diff --git a/client/react-native/common/relay/updater.js b/client/react-native/common/relay/updater.js index 97f06ddb9f..f8cafe9b7d 100644 --- a/client/react-native/common/relay/updater.js +++ b/client/react-native/common/relay/updater.js @@ -7,5 +7,23 @@ export default store => ({ const connection = ConnectionHandler.getConnection(root, name, args) ConnectionHandler.deleteNode(connection, id) }, + add: (edgeType, id) => { + const node = store.get(id) + const root = store.getRoot() + const connection = ConnectionHandler.getConnection(root, name, args) + const edge = ConnectionHandler.createEdge( + store, + connection, + node, + edgeType + ) + return { + // TODO: search cursor in connection to add after or before defined cursor + after: cursor => + ConnectionHandler.insertEdgeAfter(connection, edge, cursor), + before: cursor => + ConnectionHandler.insertEdgeBefore(connection, edge, cursor), + } + }, }), }) diff --git a/client/react-native/common/schema.graphql b/client/react-native/common/schema.graphql index 55bfc9b141..3d646af53b 100644 --- a/client/react-native/common/schema.graphql +++ b/client/react-native/common/schema.graphql @@ -382,6 +382,10 @@ type BertyNodeEventEdge { node: BertyP2pEvent cursor: String! } +type BertyNodeEventListConnection { + edges: [BertyNodeEventEdge] + pageInfo: BertyNodePageInfo! +} type BertyNodeContactEdge { node: BertyEntityContact cursor: String! @@ -556,8 +560,13 @@ type Query { node(id: ID!): Node EventList( filter: BertyP2pEventInput - paginate: BertyNodePaginationInput - ): [BertyP2pEventPayload] + orderBy: String! + orderDesc: Bool! + first: Int32 + after: String + last: Int32 + before: String + ): BertyNodeEventListConnection GetEvent( id: ID! senderId: String! diff --git a/client/react-native/common/utils/conversation.js b/client/react-native/common/utils/conversation.js index 8c4ec9d37e..d7bf6a15ef 100644 --- a/client/react-native/common/utils/conversation.js +++ b/client/react-native/common/utils/conversation.js @@ -1,3 +1,9 @@ +export default { + id: '', + title: '', + topic: '', +} + export const getTitle = ({ title, members } = this.props) => (title && title !== '' && title) || members diff --git a/client/react-native/common/utils/event.js b/client/react-native/common/utils/event.js new file mode 100644 index 0000000000..94229f506e --- /dev/null +++ b/client/react-native/common/utils/event.js @@ -0,0 +1,8 @@ +export default { + id: '', + senderId: '', + senderApiVersion: 0, + receiverApiVersion: 0, + receiverId: '', + conversationId: '', +} diff --git a/client/react-native/common/utils/index.js b/client/react-native/common/utils/index.js index 437371cd36..21f9c8a950 100644 --- a/client/react-native/common/utils/index.js +++ b/client/react-native/common/utils/index.js @@ -1,2 +1,3 @@ export * as conversation from './conversation' export * as contact from './contact' +export * as event from './event' diff --git a/client/react-native/package.json b/client/react-native/package.json index 8f4b6ae2c1..a67957f52c 100644 --- a/client/react-native/package.json +++ b/client/react-native/package.json @@ -14,6 +14,7 @@ "babel-plugin-relay": "^1.6.2", "babel-plugin-transform-export-extensions": "^6.22.0", "concurrently": "^4.0.1", + "deepmerge": "^2.2.1", "graphql": "^14.0.2", "graphql-relay": "^0.5.5", "isomorphic-fetch": "^2.2.1", diff --git a/client/react-native/web/public/index.html b/client/react-native/web/public/index.html index f89e31e509..2b7778f23c 100644 --- a/client/react-native/web/public/index.html +++ b/client/react-native/web/public/index.html @@ -15,7 +15,7 @@ .textEllipsis { text-overflow: ellipsis; overflow: hidden; - white-space: nowrap, + white-space: nowrap; } .textBreak { word-break: break-all; diff --git a/client/react-native/yarn.lock b/client/react-native/yarn.lock index c365ae7161..06b0bd9fca 100644 --- a/client/react-native/yarn.lock +++ b/client/react-native/yarn.lock @@ -1988,6 +1988,10 @@ deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" +deepmerge@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.2.1.tgz#5d3ff22a01c00f645405a2fbc17d0778a1801170" + define-properties@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" diff --git a/core/Makefile b/core/Makefile index 88cef550a5..5ecc55c87d 100644 --- a/core/Makefile +++ b/core/Makefile @@ -24,7 +24,7 @@ TEST_OPTS ?= -v TEST_CMD ?= go test -test.timeout 3m $(TEST_OPTS) $(TEST_PATHS) PROTOC ?= protoc GQLGEN ?= gqlgen -GIN_OPTS ?= --immediate --port=2999 --appPort=1337 --build=./cmd/berty +GIN_OPTS ?= --immediate --port=2999 --appPort=1337 --build=./cmd/berty --excludeDir vendor ## diff --git a/core/api/node/graphql/gqlgen.gen.yml b/core/api/node/graphql/gqlgen.gen.yml index 1d132a795d..02e241a3ff 100644 --- a/core/api/node/graphql/gqlgen.gen.yml +++ b/core/api/node/graphql/gqlgen.gen.yml @@ -1250,18 +1250,13 @@ models: node: cursor: - BertyNodeEventListOutput: - model: berty.tech/core/api/node.EventListOutput + BertyNodeEventListConnection: + model: berty.tech/core/api/node.EventListConnection fields: edges: pageInfo: - BertyNodeEventListOutputInput: - model: berty.tech/core/api/node.EventListOutput - fields: - edges: - pageInfo: - BertyNodeEventListPayload: - model: berty.tech/core/api/node.EventListOutput + BertyNodeEventListConnectionInput: + model: berty.tech/core/api/node.EventListConnection fields: edges: pageInfo: diff --git a/core/api/node/graphql/graph/generated/generated.go b/core/api/node/graphql/graph/generated/generated.go index 277b271c9d..18098d0805 100644 --- a/core/api/node/graphql/graph/generated/generated.go +++ b/core/api/node/graphql/graph/generated/generated.go @@ -195,6 +195,11 @@ type ComplexityRoot struct { Cursor func(childComplexity int) int } + BertyNodeEventListConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + } + BertyNodeIntegrationTestPayload struct { Name func(childComplexity int) int Success func(childComplexity int) int @@ -535,7 +540,7 @@ type ComplexityRoot struct { Query struct { Node func(childComplexity int, id string) int - EventList func(childComplexity int, filter *p2p.Event, paginate *node.Pagination) int + EventList func(childComplexity int, filter *p2p.Event, orderBy string, orderDesc bool, first *int32, after *string, last *int32, before *string) int GetEvent func(childComplexity int, id string, senderId string, createdAt *time.Time, updatedAt *time.Time, deletedAt *time.Time, sentAt *time.Time, receivedAt *time.Time, ackedAt *time.Time, direction *int32, senderApiVersion uint32, receiverApiVersion uint32, receiverId string, kind *int32, attributes []byte, conversationId string) int ContactList func(childComplexity int, filter *entity.Contact, orderBy string, orderDesc bool, first *int32, after *string, last *int32, before *string) int GetContact func(childComplexity int, id string, createdAt *time.Time, updatedAt *time.Time, deletedAt *time.Time, sigchain []byte, status *int32, devices []*entity.Device, displayName string, displayStatus string, overrideDisplayName string, overrideDisplayStatus string) int @@ -616,7 +621,7 @@ type MutationResolver interface { } type QueryResolver interface { Node(ctx context.Context, id string) (models.Node, error) - EventList(ctx context.Context, filter *p2p.Event, paginate *node.Pagination) ([]*p2p.Event, error) + EventList(ctx context.Context, filter *p2p.Event, orderBy string, orderDesc bool, first *int32, after *string, last *int32, before *string) (*node.EventListConnection, error) GetEvent(ctx context.Context, id string, senderId string, createdAt *time.Time, updatedAt *time.Time, deletedAt *time.Time, sentAt *time.Time, receivedAt *time.Time, ackedAt *time.Time, direction *int32, senderApiVersion uint32, receiverApiVersion uint32, receiverId string, kind *int32, attributes []byte, conversationId string) (*p2p.Event, error) ContactList(ctx context.Context, filter *entity.Contact, orderBy string, orderDesc bool, first *int32, after *string, last *int32, before *string) (*node.ContactListConnection, error) GetContact(ctx context.Context, id string, createdAt *time.Time, updatedAt *time.Time, deletedAt *time.Time, sigchain []byte, status *int32, devices []*entity.Device, displayName string, displayStatus string, overrideDisplayName string, overrideDisplayStatus string) (*entity.Contact, error) @@ -1343,20 +1348,80 @@ func field_Query_EventList_args(rawArgs map[string]interface{}) (map[string]inte } } args["filter"] = arg0 - var arg1 *node.Pagination - if tmp, ok := rawArgs["paginate"]; ok { + var arg1 string + if tmp, ok := rawArgs["orderBy"]; ok { + var err error + arg1, err = models.UnmarshalString(tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg1 + var arg2 bool + if tmp, ok := rawArgs["orderDesc"]; ok { var err error - var ptr1 node.Pagination + arg2, err = models.UnmarshalBool(tmp) + if err != nil { + return nil, err + } + } + args["orderDesc"] = arg2 + var arg3 *int32 + if tmp, ok := rawArgs["first"]; ok { + var err error + var ptr1 int32 if tmp != nil { - ptr1, err = UnmarshalBertyNodePaginationInput(tmp) - arg1 = &ptr1 + ptr1, err = models.UnmarshalInt32(tmp) + arg3 = &ptr1 + } + + if err != nil { + return nil, err + } + } + args["first"] = arg3 + var arg4 *string + if tmp, ok := rawArgs["after"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = models.UnmarshalString(tmp) + arg4 = &ptr1 + } + + if err != nil { + return nil, err + } + } + args["after"] = arg4 + var arg5 *int32 + if tmp, ok := rawArgs["last"]; ok { + var err error + var ptr1 int32 + if tmp != nil { + ptr1, err = models.UnmarshalInt32(tmp) + arg5 = &ptr1 + } + + if err != nil { + return nil, err + } + } + args["last"] = arg5 + var arg6 *string + if tmp, ok := rawArgs["before"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = models.UnmarshalString(tmp) + arg6 = &ptr1 } if err != nil { return nil, err } } - args["paginate"] = arg1 + args["before"] = arg6 return args, nil } @@ -2797,6 +2862,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.BertyNodeEventEdge.Cursor(childComplexity), true + case "BertyNodeEventListConnection.edges": + if e.complexity.BertyNodeEventListConnection.Edges == nil { + break + } + + return e.complexity.BertyNodeEventListConnection.Edges(childComplexity), true + + case "BertyNodeEventListConnection.pageInfo": + if e.complexity.BertyNodeEventListConnection.PageInfo == nil { + break + } + + return e.complexity.BertyNodeEventListConnection.PageInfo(childComplexity), true + case "BertyNodeIntegrationTestPayload.name": if e.complexity.BertyNodeIntegrationTestPayload.Name == nil { break @@ -4248,7 +4327,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.EventList(childComplexity, args["filter"].(*p2p.Event), args["paginate"].(*node.Pagination)), true + return e.complexity.Query.EventList(childComplexity, args["filter"].(*p2p.Event), args["orderBy"].(string), args["orderDesc"].(bool), args["first"].(*int32), args["after"].(*string), args["last"].(*int32), args["before"].(*string)), true case "Query.GetEvent": if e.complexity.Query.GetEvent == nil { @@ -7359,6 +7438,126 @@ func (ec *executionContext) _BertyNodeEventEdge_cursor(ctx context.Context, fiel return models.MarshalString(res) } +var bertyNodeEventListConnectionImplementors = []string{"BertyNodeEventListConnection"} + +// nolint: gocyclo, errcheck, gas, goconst +func (ec *executionContext) _BertyNodeEventListConnection(ctx context.Context, sel ast.SelectionSet, obj *node.EventListConnection) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, bertyNodeEventListConnectionImplementors) + + out := graphql.NewOrderedMap(len(fields)) + invalid := false + for i, field := range fields { + out.Keys[i] = field.Alias + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("BertyNodeEventListConnection") + case "edges": + out.Values[i] = ec._BertyNodeEventListConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._BertyNodeEventListConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + + if invalid { + return graphql.Null + } + return out +} + +// nolint: vetshadow +func (ec *executionContext) _BertyNodeEventListConnection_edges(ctx context.Context, field graphql.CollectedField, obj *node.EventListConnection) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "BertyNodeEventListConnection", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*node.EventEdge) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } + + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { + + if res[idx1] == nil { + return graphql.Null + } + + return ec._BertyNodeEventEdge(ctx, field.Selections, res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 +} + +// nolint: vetshadow +func (ec *executionContext) _BertyNodeEventListConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *node.EventListConnection) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "BertyNodeEventListConnection", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*node.PageInfo) + rctx.Result = res + + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + + return ec._BertyNodePageInfo(ctx, field.Selections, res) +} + var bertyNodeIntegrationTestPayloadImplementors = []string{"BertyNodeIntegrationTestPayload"} // nolint: gocyclo, errcheck, gas, goconst @@ -15569,51 +15768,19 @@ func (ec *executionContext) _Query_EventList(ctx context.Context, field graphql. ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().EventList(rctx, args["filter"].(*p2p.Event), args["paginate"].(*node.Pagination)) + return ec.resolvers.Query().EventList(rctx, args["filter"].(*p2p.Event), args["orderBy"].(string), args["orderDesc"].(bool), args["first"].(*int32), args["after"].(*string), args["last"].(*int32), args["before"].(*string)) }) if resTmp == nil { return graphql.Null } - res := resTmp.([]*p2p.Event) + res := resTmp.(*node.EventListConnection) rctx.Result = res - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) + if res == nil { + return graphql.Null } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - if res[idx1] == nil { - return graphql.Null - } - - return ec._BertyP2pEventPayload(ctx, field.Selections, res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) - } - - } - wg.Wait() - return arr1 + return ec._BertyNodeEventListConnection(ctx, field.Selections, res) } // nolint: vetshadow @@ -18252,6 +18419,10 @@ type BertyNodeEventEdge { node: BertyP2pEvent cursor: String! } +type BertyNodeEventListConnection { + edges: [BertyNodeEventEdge] + pageInfo: BertyNodePageInfo! +} type BertyNodeContactEdge { node: BertyEntityContact cursor: String! @@ -18426,8 +18597,13 @@ type Query { node(id: ID!): Node EventList( filter: BertyP2pEventInput - paginate: BertyNodePaginationInput - ): [BertyP2pEventPayload] + orderBy: String! + orderDesc: Bool! + first: Int32 + after: String + last: Int32 + before: String + ): BertyNodeEventListConnection GetEvent( id: ID! senderId: String! diff --git a/core/api/node/graphql/resolver.go b/core/api/node/graphql/resolver.go index 9d83c7b2ed..02256d9e25 100644 --- a/core/api/node/graphql/resolver.go +++ b/core/api/node/graphql/resolver.go @@ -239,30 +239,78 @@ func (r *queryResolver) Node(ctx context.Context, id string) (models.Node, error } } -func (r *queryResolver) EventList(ctx context.Context, filter *p2p.Event, paginate *node.Pagination) ([]*p2p.Event, error) { - var list []*p2p.Event +func (r *queryResolver) EventList(ctx context.Context, filter *p2p.Event, orderBy string, orderDesc bool, first *int32, after *string, last *int32, before *string) (*node.EventListConnection, error) { if filter != nil { + if filter.ID != "" { + filter.ID = strings.SplitN(filter.ID, ":", 2)[1] + } if filter.ConversationID != "" { filter.ConversationID = strings.SplitN(filter.ConversationID, ":", 2)[1] } } - stream, err := r.client.EventList(ctx, &node.EventListInput{Paginate: paginate, Filter: &p2p.Event{ - ConversationID: filter.ConversationID, - }}) + + input := &node.EventListInput{ + Filter: filter, + Paginate: getPagination(first, after, last, before), + } + + input.Paginate.OrderBy = orderBy + input.Paginate.OrderDesc = orderDesc + + input.Paginate.First++ // querying one more field to fullfil HasNextPage, FIXME: optimize this + + stream, err := r.client.EventList(ctx, input) if err != nil { return nil, err } + + output := &node.EventListConnection{ + Edges: []*node.EventEdge{}, + } + count := int32(0) + hasNextPage := false for { - elem, err := stream.Recv() + n, err := stream.Recv() if err == io.EOF { break } if err != nil { return nil, err } - list = append(list, elem) + if count >= input.Paginate.First-1 { // related to input.Paginate.First++ + hasNextPage = true + break + } + count++ + + var cursor string + switch orderBy { + case "", "id": + cursor = n.ID + case "created_at": + cursor = n.CreatedAt.String() + case "updated_at": + cursor = n.UpdatedAt.String() + } + + output.Edges = append(output.Edges, &node.EventEdge{ + Node: n, + Cursor: cursor, + }) + } + + output.PageInfo = &node.PageInfo{} + if len(output.Edges) == 0 { + output.PageInfo.StartCursor = "" + output.PageInfo.EndCursor = "" + } else { + output.PageInfo.StartCursor = output.Edges[0].Cursor + output.PageInfo.EndCursor = output.Edges[len(output.Edges)-1].Cursor } - return list, nil + + output.PageInfo.HasPreviousPage = input.Paginate.After != "" + output.PageInfo.HasNextPage = hasNextPage + return output, nil } func (r *queryResolver) GetEvent(ctx context.Context, id string, senderID string, createdAt *time.Time, updatedAt *time.Time, deletedAt *time.Time, sentAt *time.Time, receivedAt *time.Time, ackedAt *time.Time, direction *int32, senderAPIVersion uint32, receiverAPIVersion uint32, receiverID string, kind *int32, attributes []byte, conversationID string) (*p2p.Event, error) { @@ -270,6 +318,7 @@ func (r *queryResolver) GetEvent(ctx context.Context, id string, senderID string ID: strings.SplitN(id, ":", 2)[1], }) } + func (r *queryResolver) ContactList(ctx context.Context, filter *entity.Contact, orderBy string, orderDesc bool, first *int32, after *string, last *int32, before *string) (*node.ContactListConnection, error) { if filter != nil && filter.ID != "" { filter.ID = strings.SplitN(filter.ID, ":", 2)[1] diff --git a/core/api/node/graphql/service.gen.graphql b/core/api/node/graphql/service.gen.graphql index 55bfc9b141..3d646af53b 100644 --- a/core/api/node/graphql/service.gen.graphql +++ b/core/api/node/graphql/service.gen.graphql @@ -382,6 +382,10 @@ type BertyNodeEventEdge { node: BertyP2pEvent cursor: String! } +type BertyNodeEventListConnection { + edges: [BertyNodeEventEdge] + pageInfo: BertyNodePageInfo! +} type BertyNodeContactEdge { node: BertyEntityContact cursor: String! @@ -556,8 +560,13 @@ type Query { node(id: ID!): Node EventList( filter: BertyP2pEventInput - paginate: BertyNodePaginationInput - ): [BertyP2pEventPayload] + orderBy: String! + orderDesc: Bool! + first: Int32 + after: String + last: Int32 + before: String + ): BertyNodeEventListConnection GetEvent( id: ID! senderId: String! diff --git a/core/api/node/service.pb.go b/core/api/node/service.pb.go index 225ff6460b..f481b817f9 100644 --- a/core/api/node/service.pb.go +++ b/core/api/node/service.pb.go @@ -46,7 +46,7 @@ func (m *DeviceInfosOutput) Reset() { *m = DeviceInfosOutput{} } func (m *DeviceInfosOutput) String() string { return proto.CompactTextString(m) } func (*DeviceInfosOutput) ProtoMessage() {} func (*DeviceInfosOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{0} + return fileDescriptor_service_068ff4384fcb3b34, []int{0} } func (m *DeviceInfosOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -94,7 +94,7 @@ func (m *DeviceInfo) Reset() { *m = DeviceInfo{} } func (m *DeviceInfo) String() string { return proto.CompactTextString(m) } func (*DeviceInfo) ProtoMessage() {} func (*DeviceInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{1} + return fileDescriptor_service_068ff4384fcb3b34, []int{1} } func (m *DeviceInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -148,7 +148,7 @@ func (m *AppVersionOutput) Reset() { *m = AppVersionOutput{} } func (m *AppVersionOutput) String() string { return proto.CompactTextString(m) } func (*AppVersionOutput) ProtoMessage() {} func (*AppVersionOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{2} + return fileDescriptor_service_068ff4384fcb3b34, []int{2} } func (m *AppVersionOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -195,7 +195,7 @@ func (m *PingDestination) Reset() { *m = PingDestination{} } func (m *PingDestination) String() string { return proto.CompactTextString(m) } func (*PingDestination) ProtoMessage() {} func (*PingDestination) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{3} + return fileDescriptor_service_068ff4384fcb3b34, []int{3} } func (m *PingDestination) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -243,7 +243,7 @@ func (m *ContactRequestInput) Reset() { *m = ContactRequestInput{} } func (m *ContactRequestInput) String() string { return proto.CompactTextString(m) } func (*ContactRequestInput) ProtoMessage() {} func (*ContactRequestInput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{4} + return fileDescriptor_service_068ff4384fcb3b34, []int{4} } func (m *ContactRequestInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -298,7 +298,7 @@ func (m *ConversationAddMessageInput) Reset() { *m = ConversationAddMess func (m *ConversationAddMessageInput) String() string { return proto.CompactTextString(m) } func (*ConversationAddMessageInput) ProtoMessage() {} func (*ConversationAddMessageInput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{5} + return fileDescriptor_service_068ff4384fcb3b34, []int{5} } func (m *ConversationAddMessageInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -352,7 +352,7 @@ func (m *EventStreamInput) Reset() { *m = EventStreamInput{} } func (m *EventStreamInput) String() string { return proto.CompactTextString(m) } func (*EventStreamInput) ProtoMessage() {} func (*EventStreamInput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{6} + return fileDescriptor_service_068ff4384fcb3b34, []int{6} } func (m *EventStreamInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -388,6 +388,9 @@ func (m *EventStreamInput) GetFilter() *p2p.Event { return nil } +// +// EventList +// type EventListInput struct { Filter *p2p.Event `protobuf:"bytes,1,opt,name=filter" json:"filter,omitempty"` Paginate *Pagination `protobuf:"bytes,99,opt,name=paginate" json:"paginate,omitempty"` @@ -400,7 +403,7 @@ func (m *EventListInput) Reset() { *m = EventListInput{} } func (m *EventListInput) String() string { return proto.CompactTextString(m) } func (*EventListInput) ProtoMessage() {} func (*EventListInput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{7} + return fileDescriptor_service_068ff4384fcb3b34, []int{7} } func (m *EventListInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -455,7 +458,7 @@ func (m *EventEdge) Reset() { *m = EventEdge{} } func (m *EventEdge) String() string { return proto.CompactTextString(m) } func (*EventEdge) ProtoMessage() {} func (*EventEdge) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{8} + return fileDescriptor_service_068ff4384fcb3b34, []int{8} } func (m *EventEdge) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -498,7 +501,7 @@ func (m *EventEdge) GetCursor() string { return "" } -type EventListOutput struct { +type EventListConnection struct { Edges []*EventEdge `protobuf:"bytes,1,rep,name=edges" json:"edges,omitempty"` PageInfo *PageInfo `protobuf:"bytes,99,opt,name=page_info,json=pageInfo" json:"page_info,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -506,18 +509,18 @@ type EventListOutput struct { XXX_sizecache int32 `json:"-"` } -func (m *EventListOutput) Reset() { *m = EventListOutput{} } -func (m *EventListOutput) String() string { return proto.CompactTextString(m) } -func (*EventListOutput) ProtoMessage() {} -func (*EventListOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{9} +func (m *EventListConnection) Reset() { *m = EventListConnection{} } +func (m *EventListConnection) String() string { return proto.CompactTextString(m) } +func (*EventListConnection) ProtoMessage() {} +func (*EventListConnection) Descriptor() ([]byte, []int) { + return fileDescriptor_service_068ff4384fcb3b34, []int{9} } -func (m *EventListOutput) XXX_Unmarshal(b []byte) error { +func (m *EventListConnection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *EventListOutput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *EventListConnection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_EventListOutput.Marshal(b, m, deterministic) + return xxx_messageInfo_EventListConnection.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalTo(b) @@ -527,26 +530,26 @@ func (m *EventListOutput) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (dst *EventListOutput) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventListOutput.Merge(dst, src) +func (dst *EventListConnection) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventListConnection.Merge(dst, src) } -func (m *EventListOutput) XXX_Size() int { +func (m *EventListConnection) XXX_Size() int { return m.Size() } -func (m *EventListOutput) XXX_DiscardUnknown() { - xxx_messageInfo_EventListOutput.DiscardUnknown(m) +func (m *EventListConnection) XXX_DiscardUnknown() { + xxx_messageInfo_EventListConnection.DiscardUnknown(m) } -var xxx_messageInfo_EventListOutput proto.InternalMessageInfo +var xxx_messageInfo_EventListConnection proto.InternalMessageInfo -func (m *EventListOutput) GetEdges() []*EventEdge { +func (m *EventListConnection) GetEdges() []*EventEdge { if m != nil { return m.Edges } return nil } -func (m *EventListOutput) GetPageInfo() *PageInfo { +func (m *EventListConnection) GetPageInfo() *PageInfo { if m != nil { return m.PageInfo } @@ -568,7 +571,7 @@ func (m *ContactListInput) Reset() { *m = ContactListInput{} } func (m *ContactListInput) String() string { return proto.CompactTextString(m) } func (*ContactListInput) ProtoMessage() {} func (*ContactListInput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{10} + return fileDescriptor_service_068ff4384fcb3b34, []int{10} } func (m *ContactListInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -623,7 +626,7 @@ func (m *ContactEdge) Reset() { *m = ContactEdge{} } func (m *ContactEdge) String() string { return proto.CompactTextString(m) } func (*ContactEdge) ProtoMessage() {} func (*ContactEdge) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{11} + return fileDescriptor_service_068ff4384fcb3b34, []int{11} } func (m *ContactEdge) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -678,7 +681,7 @@ func (m *ContactListConnection) Reset() { *m = ContactListConnection{} } func (m *ContactListConnection) String() string { return proto.CompactTextString(m) } func (*ContactListConnection) ProtoMessage() {} func (*ContactListConnection) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{12} + return fileDescriptor_service_068ff4384fcb3b34, []int{12} } func (m *ContactListConnection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -736,7 +739,7 @@ func (m *ConversationListInput) Reset() { *m = ConversationListInput{} } func (m *ConversationListInput) String() string { return proto.CompactTextString(m) } func (*ConversationListInput) ProtoMessage() {} func (*ConversationListInput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{13} + return fileDescriptor_service_068ff4384fcb3b34, []int{13} } func (m *ConversationListInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -791,7 +794,7 @@ func (m *ConversationEdge) Reset() { *m = ConversationEdge{} } func (m *ConversationEdge) String() string { return proto.CompactTextString(m) } func (*ConversationEdge) ProtoMessage() {} func (*ConversationEdge) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{14} + return fileDescriptor_service_068ff4384fcb3b34, []int{14} } func (m *ConversationEdge) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -846,7 +849,7 @@ func (m *ConversationListConnection) Reset() { *m = ConversationListConn func (m *ConversationListConnection) String() string { return proto.CompactTextString(m) } func (*ConversationListConnection) ProtoMessage() {} func (*ConversationListConnection) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{15} + return fileDescriptor_service_068ff4384fcb3b34, []int{15} } func (m *ConversationListConnection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -902,7 +905,7 @@ func (m *ConversationCreateInput) Reset() { *m = ConversationCreateInput func (m *ConversationCreateInput) String() string { return proto.CompactTextString(m) } func (*ConversationCreateInput) ProtoMessage() {} func (*ConversationCreateInput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{16} + return fileDescriptor_service_068ff4384fcb3b34, []int{16} } func (m *ConversationCreateInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -964,7 +967,7 @@ func (m *ConversationManageMembersInput) Reset() { *m = ConversationMana func (m *ConversationManageMembersInput) String() string { return proto.CompactTextString(m) } func (*ConversationManageMembersInput) ProtoMessage() {} func (*ConversationManageMembersInput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{17} + return fileDescriptor_service_068ff4384fcb3b34, []int{17} } func (m *ConversationManageMembersInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1018,7 +1021,7 @@ func (m *Void) Reset() { *m = Void{} } func (m *Void) String() string { return proto.CompactTextString(m) } func (*Void) ProtoMessage() {} func (*Void) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{18} + return fileDescriptor_service_068ff4384fcb3b34, []int{18} } func (m *Void) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1072,7 +1075,7 @@ func (m *Pagination) Reset() { *m = Pagination{} } func (m *Pagination) String() string { return proto.CompactTextString(m) } func (*Pagination) ProtoMessage() {} func (*Pagination) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{19} + return fileDescriptor_service_068ff4384fcb3b34, []int{19} } func (m *Pagination) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1159,7 +1162,7 @@ func (m *PageInfo) Reset() { *m = PageInfo{} } func (m *PageInfo) String() string { return proto.CompactTextString(m) } func (*PageInfo) ProtoMessage() {} func (*PageInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{20} + return fileDescriptor_service_068ff4384fcb3b34, []int{20} } func (m *PageInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1234,7 +1237,7 @@ func (m *IntegrationTestInput) Reset() { *m = IntegrationTestInput{} } func (m *IntegrationTestInput) String() string { return proto.CompactTextString(m) } func (*IntegrationTestInput) ProtoMessage() {} func (*IntegrationTestInput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{21} + return fileDescriptor_service_068ff4384fcb3b34, []int{21} } func (m *IntegrationTestInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1285,7 +1288,7 @@ func (m *IntegrationTestOutput) Reset() { *m = IntegrationTestOutput{} } func (m *IntegrationTestOutput) String() string { return proto.CompactTextString(m) } func (*IntegrationTestOutput) ProtoMessage() {} func (*IntegrationTestOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_dddd8539c7df8b06, []int{22} + return fileDescriptor_service_068ff4384fcb3b34, []int{22} } func (m *IntegrationTestOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1359,7 +1362,7 @@ func init() { proto.RegisterType((*EventStreamInput)(nil), "berty.node.EventStreamInput") proto.RegisterType((*EventListInput)(nil), "berty.node.EventListInput") proto.RegisterType((*EventEdge)(nil), "berty.node.EventEdge") - proto.RegisterType((*EventListOutput)(nil), "berty.node.EventListOutput") + proto.RegisterType((*EventListConnection)(nil), "berty.node.EventListConnection") proto.RegisterType((*ContactListInput)(nil), "berty.node.ContactListInput") proto.RegisterType((*ContactEdge)(nil), "berty.node.ContactEdge") proto.RegisterType((*ContactListConnection)(nil), "berty.node.ContactListConnection") @@ -2566,7 +2569,7 @@ func (m *EventEdge) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *EventListOutput) Marshal() (dAtA []byte, err error) { +func (m *EventListConnection) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2576,7 +2579,7 @@ func (m *EventListOutput) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *EventListOutput) MarshalTo(dAtA []byte) (int, error) { +func (m *EventListConnection) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int @@ -3358,7 +3361,7 @@ func (m *EventEdge) Size() (n int) { return n } -func (m *EventListOutput) Size() (n int) { +func (m *EventListConnection) Size() (n int) { if m == nil { return 0 } @@ -4580,7 +4583,7 @@ func (m *EventEdge) Unmarshal(dAtA []byte) error { } return nil } -func (m *EventListOutput) Unmarshal(dAtA []byte) error { +func (m *EventListConnection) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4603,10 +4606,10 @@ func (m *EventListOutput) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: EventListOutput: wiretype end group for non-group") + return fmt.Errorf("proto: EventListConnection: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: EventListOutput: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EventListConnection: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -6449,103 +6452,102 @@ var ( ErrIntOverflowService = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("api/node/service.proto", fileDescriptor_service_dddd8539c7df8b06) } - -var fileDescriptor_service_dddd8539c7df8b06 = []byte{ - // 1506 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4b, 0x6f, 0xdb, 0xc6, - 0x16, 0x0e, 0x13, 0xc9, 0x96, 0x8e, 0xec, 0xd8, 0x99, 0xd8, 0x8e, 0xac, 0x38, 0x7e, 0xf0, 0x5e, - 0xdc, 0xeb, 0xeb, 0x9b, 0x48, 0x89, 0x5c, 0xa0, 0x0f, 0x04, 0x05, 0xfc, 0x8a, 0x6b, 0xb4, 0x6e, - 0x1d, 0xc6, 0xcd, 0x22, 0x1b, 0x61, 0x44, 0x1e, 0xc9, 0x6c, 0x64, 0x92, 0x21, 0x87, 0x82, 0x8d, - 0x2e, 0x5a, 0xa0, 0x28, 0x90, 0x6e, 0x8a, 0x2e, 0xbb, 0xe8, 0xaf, 0xe8, 0xa2, 0xbf, 0x21, 0xcb, - 0x22, 0x3f, 0xa0, 0x2d, 0xd2, 0x65, 0x37, 0xee, 0xb6, 0xab, 0x62, 0x86, 0xc3, 0xa7, 0x28, 0xc5, - 0x41, 0xd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x03, - 0xb8, 0x1c, 0xcd, 0x34, 0x71, 0x47, 0x70, 0x55, 0xf3, 0xad, 0x4c, 0xe7, 0xf4, 0xa2, 0x04, 0x85, - 0x5a, 0x5e, 0x13, 0xae, 0xad, 0x8c, 0x40, 0x04, 0x9d, 0x37, 0xe3, 0xe9, 0x2e, 0x94, 0xb7, 0xb1, - 0xed, 0x77, 0xf9, 0x87, 0x3c, 0xb9, 0x9e, 0x9a, 0x4e, 0xd3, 0x9f, 0xf6, 0xb9, 0xd9, 0xee, 0x41, - 0x25, 0xf1, 0xa3, 0x22, 0x27, 0xd1, 0x1b, 0xf9, 0x7f, 0x29, 0xe4, 0x3f, 0x8d, 0x24, 0xdb, 0xbb, - 0x00, 0xf1, 0xaf, 0x87, 0x1c, 0x4b, 0xa9, 0x5b, 0x32, 0xfb, 0x93, 0x22, 0x61, 0x68, 0x73, 0xed, - 0xd9, 0x8b, 0x45, 0xe5, 0xe7, 0x17, 0x8b, 0xca, 0x6f, 0x2f, 0x16, 0x95, 0xef, 0x7f, 0x5f, 0xbc, - 0xf0, 0xa8, 0x1a, 0x68, 0x32, 0xd4, 0x8f, 0x1a, 0xba, 0xed, 0x62, 0x23, 0xfc, 0x63, 0xd4, 0x1e, - 0x13, 0xbd, 0x7d, 0xfd, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x13, 0x8d, 0x16, 0xc7, 0x44, 0x12, - 0x00, 0x00, +func init() { proto.RegisterFile("api/node/service.proto", fileDescriptor_service_068ff4384fcb3b34) } + +var fileDescriptor_service_068ff4384fcb3b34 = []byte{ + // 1497 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4b, 0x73, 0xdb, 0x54, + 0x14, 0xae, 0x5a, 0x3b, 0xb1, 0x8f, 0x93, 0x26, 0xbd, 0x79, 0xd4, 0x71, 0xd3, 0x3c, 0x04, 0x03, + 0x21, 0xb4, 0x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8, 0x43, 0xd9, 0xb3, 0xda, 0xb6, 0xf7, 0x85, 0xcf, + 0x1c, 0x9f, 0x91, 0x1b, 0x50, 0x34, 0xf9, 0xb1, 0xaa, 0x2c, 0x5d, 0x5a, 0xa9, 0xac, 0xcd, 0xd6, + 0xe3, 0xf8, 0xea, 0x31, 0xb7, 0x16, 0x30, 0xa9, 0xef, 0x02, 0xc4, 0x44, 0x32, 0x09, 0x97, 0x1e, + 0xe0, 0x69, 0x55, 0x59, 0x52, 0x56, 0xca, 0x1a, 0x7f, 0x24, 0xd3, 0x50, 0xec, 0xd1, 0xae, 0x8f, + 0xd5, 0x8b, 0x82, 0x16, 0x1c, 0xd4, 0x1b, 0x30, 0xb9, 0xe1, 0x38, 0xf7, 0xd0, 0xf5, 0x4c, 0xdb, + 0x92, 0x76, 0xab, 0x30, 0xda, 0x0b, 0x08, 0x52, 0x3e, 0x3c, 0xaa, 0xeb, 0x30, 0x71, 0x60, 0x5a, + 0x9d, 0x6d, 0xf4, 0x98, 0x69, 0x09, 0x30, 0xc8, 0x12, 0x54, 0x8c, 0xf8, 0x28, 0x05, 0x92, 0x24, + 0x15, 0x61, 0x6a, 0x2b, 0x00, 0x55, 0xc3, 0x87, 0x3e, 0x7a, 0x6c, 0xcf, 0xe2, 0x56, 0x1a, 0x30, + 0x2a, 0xb1, 0x16, 0x42, 0x95, 0xb5, 0x19, 0x19, 0x5f, 0x80, 0x6b, 0x3d, 0x94, 0x09, 0xb9, 0xc8, + 0x75, 0x00, 0xd3, 0x62, 0xae, 0xdd, 0x64, 0x78, 0xc2, 0x64, 0x14, 0x65, 0x41, 0x39, 0xc4, 0x13, + 0xa6, 0x7e, 0xaf, 0xc0, 0xb5, 0xad, 0x44, 0x9a, 0x36, 0x0c, 0x63, 0x3f, 0x48, 0x4d, 0x60, 0xef, + 0x23, 0x18, 0x4b, 0x66, 0x51, 0x1a, 0xad, 0xf5, 0x19, 0x8d, 0x38, 0xb4, 0x14, 0x3f, 0xf7, 0x57, +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12, 0x00, 0x00, } diff --git a/core/api/node/service.proto b/core/api/node/service.proto index 937b694bb7..434c5c75b1 100644 --- a/core/api/node/service.proto +++ b/core/api/node/service.proto @@ -26,6 +26,7 @@ service Service { }; // list old events rpc EventList(EventListInput) returns (stream berty.p2p.Event) { + option (berty.gql.graphql_output) = ".berty.node.EventListConnection"; option (berty.gql.graphql_type) = "Query"; }; rpc GetEvent(berty.p2p.Event) returns (berty.p2p.Event) { @@ -146,17 +147,21 @@ message EventStreamInput { berty.p2p.Event filter = 1; } + +// +// EventList +// message EventListInput { berty.p2p.Event filter = 1; - Pagination paginate = 99; + Pagination paginate = 99 [(berty.gql.graphql_spread) = true]; } message EventEdge { berty.p2p.Event node = 1; string cursor = 2; } -message EventListOutput { +message EventListConnection { repeated EventEdge edges = 1; - PageInfo page_info = 99; + PageInfo page_info = 99 [(berty.gql.graphql_non_nullable) = true]; } diff --git a/core/api/p2p/event.go b/core/api/p2p/event.go index b96e0cedd3..714355677e 100644 --- a/core/api/p2p/event.go +++ b/core/api/p2p/event.go @@ -9,7 +9,7 @@ import ( func NewOutgoingEvent(sender, receiver string, kind Kind) *Event { return &Event{ SenderAPIVersion: Version, - CreatedAt: time.Now(), + CreatedAt: time.Now().UTC(), Kind: kind, SenderID: sender, ReceiverID: receiver, diff --git a/core/cmd/berty/main.go b/core/cmd/berty/main.go index e0587b5e84..07f4378430 100644 --- a/core/cmd/berty/main.go +++ b/core/cmd/berty/main.go @@ -8,7 +8,7 @@ import ( ) func main() { - rand.Seed(time.Now().UTC().UnixNano()) + rand.Seed(time.Now().UnixNano()) rootCmd := newRootCommand() if err := rootCmd.Execute(); err != nil { diff --git a/core/crypto/sigchain/sigchain.go b/core/crypto/sigchain/sigchain.go index 00309cfe58..e562e3c30c 100644 --- a/core/crypto/sigchain/sigchain.go +++ b/core/crypto/sigchain/sigchain.go @@ -85,7 +85,7 @@ func (m *SigChain) Init(cryptoImpl keypair.Interface, identityID string) error { EventType: SigEvent_INIT_CHAIN, Payload: payload, PublicKey: signedCertificate.Content.PublicKey, - CreatedAt: time.Now(), + CreatedAt: time.Now().UTC(), Issuer: identityID, Subject: identityID, } @@ -146,7 +146,7 @@ func (m *SigChain) AddDevice(cryptoImpl keypair.Interface, selfIdentityID, ident ParentHash: m.Events[len(m.Events)-1].Hash, Payload: payload, PublicKey: publicKey, - CreatedAt: time.Now(), + CreatedAt: time.Now().UTC(), Issuer: currentDevice.Content.Issuer, Subject: identityID, } @@ -194,7 +194,7 @@ func (m *SigChain) RemoveDevice(cryptoImpl keypair.Interface, selfIdentityID, id ParentHash: m.Events[len(m.Events)-1].Hash, Payload: payload, PublicKey: certificate.Content.PublicKey, - CreatedAt: time.Now(), + CreatedAt: time.Now().UTC(), Issuer: currentCertificate.Content.Subject, Subject: certificate.Content.Subject, } diff --git a/core/entity/sender_alias_test.go b/core/entity/sender_alias_test.go index 6a91128718..5e56d7bc3a 100644 --- a/core/entity/sender_alias_test.go +++ b/core/entity/sender_alias_test.go @@ -109,30 +109,30 @@ func TestSenderAliasGetCandidates(t *testing.T) { for i := 0; i < 10; i++ { for j := 1; j < 5; j++ { time.Sleep(time.Millisecond) - db.Save(&SenderAlias{CreatedAt: time.Now(), OriginDeviceID: fmt.Sprintf("DeviceA%d", j), ConversationID: "", AliasIdentifier: fmt.Sprintf("AliasA%d", i), Status: SenderAlias_RECEIVED}) + db.Save(&SenderAlias{CreatedAt: time.Now().UTC(), OriginDeviceID: fmt.Sprintf("DeviceA%d", j), ConversationID: "", AliasIdentifier: fmt.Sprintf("AliasA%d", i), Status: SenderAlias_RECEIVED}) time.Sleep(time.Millisecond) - db.Save(&SenderAlias{CreatedAt: time.Now(), OriginDeviceID: fmt.Sprintf("DeviceB%d", j), ConversationID: "", AliasIdentifier: fmt.Sprintf("AliasB%d", i), Status: SenderAlias_RECEIVED}) + db.Save(&SenderAlias{CreatedAt: time.Now().UTC(), OriginDeviceID: fmt.Sprintf("DeviceB%d", j), ConversationID: "", AliasIdentifier: fmt.Sprintf("AliasB%d", i), Status: SenderAlias_RECEIVED}) time.Sleep(time.Millisecond) - db.Save(&SenderAlias{CreatedAt: time.Now(), OriginDeviceID: fmt.Sprintf("DeviceC%d", j), ConversationID: "", AliasIdentifier: fmt.Sprintf("AliasC%d", i), Status: SenderAlias_RECEIVED}) + db.Save(&SenderAlias{CreatedAt: time.Now().UTC(), OriginDeviceID: fmt.Sprintf("DeviceC%d", j), ConversationID: "", AliasIdentifier: fmt.Sprintf("AliasC%d", i), Status: SenderAlias_RECEIVED}) time.Sleep(time.Millisecond) - db.Save(&SenderAlias{CreatedAt: time.Now(), OriginDeviceID: fmt.Sprintf("DeviceA%d", j), ConversationID: "ConversationA", AliasIdentifier: fmt.Sprintf("AliasConversationA%d", i), Status: SenderAlias_RECEIVED}) + db.Save(&SenderAlias{CreatedAt: time.Now().UTC(), OriginDeviceID: fmt.Sprintf("DeviceA%d", j), ConversationID: "ConversationA", AliasIdentifier: fmt.Sprintf("AliasConversationA%d", i), Status: SenderAlias_RECEIVED}) time.Sleep(time.Millisecond) - db.Save(&SenderAlias{CreatedAt: time.Now(), OriginDeviceID: fmt.Sprintf("DeviceA%d", j), ConversationID: "ConversationAB", AliasIdentifier: fmt.Sprintf("AliasConversationAB%d", i), Status: SenderAlias_RECEIVED}) + db.Save(&SenderAlias{CreatedAt: time.Now().UTC(), OriginDeviceID: fmt.Sprintf("DeviceA%d", j), ConversationID: "ConversationAB", AliasIdentifier: fmt.Sprintf("AliasConversationAB%d", i), Status: SenderAlias_RECEIVED}) time.Sleep(time.Millisecond) - db.Save(&SenderAlias{CreatedAt: time.Now(), OriginDeviceID: fmt.Sprintf("DeviceA%d", j), ConversationID: "ConversationABC", AliasIdentifier: fmt.Sprintf("AliasConversationABC%d", i), Status: SenderAlias_RECEIVED}) + db.Save(&SenderAlias{CreatedAt: time.Now().UTC(), OriginDeviceID: fmt.Sprintf("DeviceA%d", j), ConversationID: "ConversationABC", AliasIdentifier: fmt.Sprintf("AliasConversationABC%d", i), Status: SenderAlias_RECEIVED}) time.Sleep(time.Millisecond) - db.Save(&SenderAlias{CreatedAt: time.Now(), ContactID: "ContactA", ConversationID: "", AliasIdentifier: fmt.Sprintf("SentAliasA%d", i), Status: SenderAlias_SENT}) + db.Save(&SenderAlias{CreatedAt: time.Now().UTC(), ContactID: "ContactA", ConversationID: "", AliasIdentifier: fmt.Sprintf("SentAliasA%d", i), Status: SenderAlias_SENT}) } } for j := 1; j < 5; j++ { time.Sleep(time.Millisecond) - db.Save(&SenderAlias{CreatedAt: time.Now(), OriginDeviceID: fmt.Sprintf("DeviceA%d", j), ConversationID: "", AliasIdentifier: "duplicatedAlias", Status: SenderAlias_RECEIVED}) + db.Save(&SenderAlias{CreatedAt: time.Now().UTC(), OriginDeviceID: fmt.Sprintf("DeviceA%d", j), ConversationID: "", AliasIdentifier: "duplicatedAlias", Status: SenderAlias_RECEIVED}) time.Sleep(time.Millisecond) - db.Save(&SenderAlias{CreatedAt: time.Now(), OriginDeviceID: fmt.Sprintf("DeviceC%d", j), ConversationID: "ConversationABC", AliasIdentifier: "duplicatedAlias", Status: SenderAlias_RECEIVED}) + db.Save(&SenderAlias{CreatedAt: time.Now().UTC(), OriginDeviceID: fmt.Sprintf("DeviceC%d", j), ConversationID: "ConversationABC", AliasIdentifier: "duplicatedAlias", Status: SenderAlias_RECEIVED}) } results, err := SenderAliasGetCandidates(db, "AliasA1") @@ -220,13 +220,13 @@ func TestGetAliasForContact(t *testing.T) { for i := 0; i < 3; i++ { time.Sleep(time.Millisecond) - db.Save(&SenderAlias{CreatedAt: time.Now(), ContactID: "ContactA", ConversationID: "", AliasIdentifier: fmt.Sprintf("Alias-A%d", i), Status: SenderAlias_SENT}) + db.Save(&SenderAlias{CreatedAt: time.Now().UTC(), ContactID: "ContactA", ConversationID: "", AliasIdentifier: fmt.Sprintf("Alias-A%d", i), Status: SenderAlias_SENT}) time.Sleep(time.Millisecond) - db.Save(&SenderAlias{CreatedAt: time.Now(), ContactID: "ContactA", ConversationID: "", AliasIdentifier: fmt.Sprintf("AliasA%d", i), Status: SenderAlias_SENT_AND_ACKED}) + db.Save(&SenderAlias{CreatedAt: time.Now().UTC(), ContactID: "ContactA", ConversationID: "", AliasIdentifier: fmt.Sprintf("AliasA%d", i), Status: SenderAlias_SENT_AND_ACKED}) time.Sleep(time.Millisecond) - db.Save(&SenderAlias{CreatedAt: time.Now(), ContactID: "ContactB", ConversationID: "", AliasIdentifier: fmt.Sprintf("Alias-B%d", i), Status: SenderAlias_SENT}) + db.Save(&SenderAlias{CreatedAt: time.Now().UTC(), ContactID: "ContactB", ConversationID: "", AliasIdentifier: fmt.Sprintf("Alias-B%d", i), Status: SenderAlias_SENT}) time.Sleep(time.Millisecond) - db.Save(&SenderAlias{CreatedAt: time.Now(), ContactID: "ContactB", ConversationID: "", AliasIdentifier: fmt.Sprintf("AliasB%d", i), Status: SenderAlias_SENT_AND_ACKED}) + db.Save(&SenderAlias{CreatedAt: time.Now().UTC(), ContactID: "ContactB", ConversationID: "", AliasIdentifier: fmt.Sprintf("AliasB%d", i), Status: SenderAlias_SENT_AND_ACKED}) } alias, err = GetAliasForContact(db, "ContactB") @@ -253,7 +253,7 @@ func TestGetAliasForConversation(t *testing.T) { } for i := 0; i < 3; i++ { time.Sleep(time.Millisecond) - db.Save(&SenderAlias{CreatedAt: time.Now(), ContactID: "", ConversationID: "ConversationAB", AliasIdentifier: fmt.Sprintf("ConversationAB%d", i), Status: SenderAlias_SENT_AND_ACKED}) + db.Save(&SenderAlias{CreatedAt: time.Now().UTC(), ContactID: "", ConversationID: "ConversationAB", AliasIdentifier: fmt.Sprintf("ConversationAB%d", i), Status: SenderAlias_SENT_AND_ACKED}) } alias, err = GetAliasForConversation(db, "ConversationAB") diff --git a/core/node/event.go b/core/node/event.go index dc478c0b49..178761faac 100644 --- a/core/node/event.go +++ b/core/node/event.go @@ -49,7 +49,7 @@ func (n *Node) handleEvent(ctx context.Context, input *p2p.Event) error { return fmt.Errorf("event already handled") } - now := time.Now() + now := time.Now().UTC() input.Direction = p2p.Event_Incoming // set direction to incoming input.ReceivedAt = &now // set current date input.ReceiverAPIVersion = p2p.Version // it's important to keep our current version to be able to apply per-message migrations in the future diff --git a/core/node/event_handlers.go b/core/node/event_handlers.go index 6e4d19a9ff..d501578d1e 100644 --- a/core/node/event_handlers.go +++ b/core/node/event_handlers.go @@ -192,7 +192,7 @@ func (n *Node) handleAck(ctx context.Context, input *p2p.Event) error { Model(&p2p.Event{}). Where("id in (?)", ackAttrs.IDs). Count(&ackCount). - UpdateColumn("acked_at", time.Now()). + UpdateColumn("acked_at", time.Now().UTC()). Error; err != nil { return errors.Wrap(err, "unable to mark events as acked") } diff --git a/core/node/node.go b/core/node/node.go index 77dd55f5d0..19ee3d5ed4 100644 --- a/core/node/node.go +++ b/core/node/node.go @@ -46,7 +46,7 @@ func New(opts ...NewNodeOption) (*Node, error) { // FIXME: fetch myself from db outgoingEvents: make(chan *p2p.Event, 100), clientEvents: make(chan *p2p.Event, 100), - createdAt: time.Now(), + createdAt: time.Now().UTC(), } // apply optioners diff --git a/core/node/nodeapi.go b/core/node/nodeapi.go index b1ec6cca08..c6c62fac38 100644 --- a/core/node/nodeapi.go +++ b/core/node/nodeapi.go @@ -2,7 +2,6 @@ package node import ( "context" - "fmt" "berty.tech/core/api/node" "berty.tech/core/api/p2p" @@ -18,7 +17,6 @@ var _ node.ServiceServer = (*Node)(nil) // WithNodeGrpcServer registers the Node as a 'berty.node' protobuf server implementation func WithNodeGrpcServer(gs *grpc.Server) NewNodeOption { return func(n *Node) { - fmt.Printf("NODE_REGISTER_SERVICE") node.RegisterServiceServer(gs, n) } } diff --git a/core/node/nodeapi_devtools.go b/core/node/nodeapi_devtools.go index b1001f6dde..ab0026d85d 100644 --- a/core/node/nodeapi_devtools.go +++ b/core/node/nodeapi_devtools.go @@ -144,7 +144,7 @@ func (n *Node) RunIntegrationTests(ctx context.Context, input *node.IntegrationT tests := listIntegrationTests() output := &node.IntegrationTestOutput{ - StartedAt: time.Now(), + StartedAt: time.Now().UTC(), Name: input.Name, } @@ -157,7 +157,7 @@ func (n *Node) RunIntegrationTests(ctx context.Context, input *node.IntegrationT output.Success, output.Verbose = testrunner.TestRunner(input.Name, testFunc) } - output.FinishedAt = time.Now() + output.FinishedAt = time.Now().UTC() return output, nil } diff --git a/core/node/paginate.go b/core/node/paginate.go index a51148da71..65a83541c3 100644 --- a/core/node/paginate.go +++ b/core/node/paginate.go @@ -21,9 +21,11 @@ func paginate(query *gorm.DB, paginate *node.Pagination) (*gorm.DB, error) { switch paginate.OrderBy { case "": paginate.OrderBy = "id" + break case "id": case "created_at": case "updated_at": + break default: return nil, errors.Wrap(ErrNotImplemented, "'OrderBy' is only supported for 'id', 'created_at', 'updated_at'") } diff --git a/core/test/test_test.go b/core/test/test_test.go index 4b63ebe601..47383a2d1a 100644 --- a/core/test/test_test.go +++ b/core/test/test_test.go @@ -13,7 +13,7 @@ import ( ) func init() { - rand.Seed(time.Now().UTC().UnixNano()) + rand.Seed(time.Now().UnixNano()) } // @@ -41,7 +41,7 @@ func printDuration(key string) { durations = make(map[string][]time.Time) } _, fn, line, _ := runtime.Caller(1) - now := time.Now() + now := time.Now().UTC() if _, found := durations[key]; found { log.Printf("\n[duration] %s: %s:%d diff=%s total=%s\n", key, fn, line, now.Sub(durations[key][1]), now.Sub(durations[key][0])) durations[key][1] = now