Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: reduce request amount (#6721)

ecmadaof5526a59c3f0
diff --git a/backend/api/v1/inbox_service.go b/backend/api/v1/inbox_service.go
index ddc7a15c0a..064e2de1c0 100644
--- a/backend/api/v1/inbox_service.go
+++ b/backend/api/v1/inbox_service.go
@@ -78,8 +78,8 @@ func (s *InboxService) GetInboxSummary(ctx context.Context, _ *v1pb.GetInboxSumm
}
return &v1pb.InboxSummary{
- HasUnread: summary.HasUnread,
- HasUnreadError: summary.HasUnreadError,
+ Unread: int32(summary.Unread),
+ UnreadError: int32(summary.UnreadError),
}, nil
}
diff --git a/backend/store/inbox.go b/backend/store/inbox.go
index 39541105eb..655d940ae0 100644
--- a/backend/store/inbox.go
+++ b/backend/store/inbox.go
@@ -26,8 +26,8 @@ type InboxMessage struct {
// This is used by the frontend to render the inbox sidebar item without fetching the actual inbox items.
// This returns json instead of jsonapi since it't not dealing with a particular resource.
type InboxSummaryMessage struct {
- HasUnread bool
- HasUnreadError bool
+ Unread int
+ UnreadError int
}
// FindInboxMessage is the API message for finding the inbox.
@@ -111,25 +111,23 @@ func (s *Store) FindInboxSummary(ctx context.Context, principalID int) (*InboxSu
}
defer tx.Rollback()
- query := `SELECT EXISTS (SELECT 1 FROM inbox WHERE receiver_id = $1 AND status = 'UNREAD')`
+ query := `SELECT COUNT(*) FROM inbox WHERE receiver_id = $1 AND status = 'UNREAD'`
var inboxSummary InboxSummaryMessage
- if err := tx.QueryRowContext(ctx, query, principalID).Scan(&inboxSummary.HasUnread); err != nil {
+ if err := tx.QueryRowContext(ctx, query, principalID).Scan(&inboxSummary.Unread); err != nil {
if err == sql.ErrNoRows {
return nil, common.FormatDBErrorEmptyRowWithQuery(query)
}
return nil, err
}
- if inboxSummary.HasUnread {
- query2 := `SELECT EXISTS (SELECT 1 FROM inbox, activity WHERE inbox.receiver_id = $1 AND inbox.status = 'UNREAD' AND inbox.activity_id = activity.id AND activity.level = 'ERROR')`
- if err := tx.QueryRowContext(ctx, query2, principalID).Scan(&inboxSummary.HasUnreadError); err != nil {
+ if inboxSummary.Unread > 0 {
+ query2 := `SELECT COUNT(*) FROM inbox, activity WHERE inbox.receiver_id = $1 AND inbox.status = 'UNREAD' AND inbox.activity_id = activity.id AND activity.level = 'ERROR'`
+ if err := tx.QueryRowContext(ctx, query2, principalID).Scan(&inboxSummary.UnreadError); err != nil {
if err == sql.ErrNoRows {
return nil, common.FormatDBErrorEmptyRowWithQuery(query2)
}
return nil, err
}
- } else {
- inboxSummary.HasUnreadError = false
}
return &inboxSummary, nil
diff --git a/frontend/src/components/InboxList.vue b/frontend/src/components/InboxList.vue
index 5727ad63cd..46197486e1 100644
--- a/frontend/src/components/InboxList.vue
+++ b/frontend/src/components/InboxList.vue
@@ -234,7 +234,11 @@ const clickInbox = (inbox: ComposedInbox) => {
if (inbox.status == InboxMessage_Status.STATUS_UNREAD) {
inbox.status = InboxMessage_Status.STATUS_READ;
inboxV1Store.patchInbox(inbox).then(() => {
- inboxV1Store.fetchInboxSummary();
+ inboxV1Store.updateInboxSummary({
+ unread: -1,
+ unreadError:
+ inbox.activity.level === LogEntity_Level.LEVEL_ERROR ? -1 : 0,
+ });
});
}
const link = actionLink(inbox.activity);
diff --git a/frontend/src/store/modules/v1/inbox.ts b/frontend/src/store/modules/v1/inbox.ts
index e03d146113..b51987a7af 100644
--- a/frontend/src/store/modules/v1/inbox.ts
+++ b/frontend/src/store/modules/v1/inbox.ts
@@ -12,8 +12,8 @@ dayjs.extend(utc);
export const useInboxV1Store = defineStore("inbox_v1", () => {
const inboxMessageList = reactive<ComposedInbox[]>([]);
const inboxSummary = reactive<InboxSummary>({
- hasUnread: false,
- hasUnreadError: false,
+ unread: 0,
+ unreadError: 0,
});
const composeActivity = async (
@@ -37,6 +37,9 @@ export const useInboxV1Store = defineStore("inbox_v1", () => {
};
const fetchInboxList = async (readCreatedAfterTs: number) => {
+ if (inboxMessageList.length > 0) {
+ return inboxMessageList;
+ }
const resp = await inboxServiceClient.listInbox({
filter: `create_time >= ${dayjs(readCreatedAfterTs).utc().format()}`,
});
@@ -54,8 +57,14 @@ export const useInboxV1Store = defineStore("inbox_v1", () => {
const fetchInboxSummary = async () => {
const summary = await inboxServiceClient.getInboxSummary({});
- inboxSummary.hasUnread = summary.hasUnread;
- inboxSummary.hasUnreadError = summary.hasUnreadError;
+ inboxSummary.unread = summary.unread;
+ inboxSummary.unreadError = summary.unreadError;
+ return inboxSummary;
+ };
+
+ const updateInboxSummary = (summary: InboxSummary) => {
+ inboxSummary.unread += summary.unread;
+ inboxSummary.unreadError += summary.unreadError;
return inboxSummary;
};
@@ -86,6 +95,7 @@ export const useInboxV1Store = defineStore("inbox_v1", () => {
inboxMessageList,
fetchInboxList,
fetchInboxSummary,
+ updateInboxSummary,
patchInbox,
};
});
diff --git a/frontend/src/types/proto/v1/inbox_service.ts b/frontend/src/types/proto/v1/inbox_service.ts
index c58e3f33e7..c9aa153e88 100644
--- a/frontend/src/types/proto/v1/inbox_service.ts
+++ b/frontend/src/types/proto/v1/inbox_service.ts
@@ -96,8 +96,8 @@ export function inboxMessage_StatusToJSON(object: InboxMessage_Status): string {
}
export interface InboxSummary {
- hasUnread: boolean;
- hasUnreadError: boolean;
+ unread: number;
+ unreadError: number;
}
function createBaseListInboxRequest(): ListInboxRequest {
@@ -464,16 +464,16 @@ export const InboxMessage = {
};
function createBaseInboxSummary(): InboxSummary {
- return { hasUnread: false, hasUnreadError: false };
+ return { unread: 0, unreadError: 0 };
}
export const InboxSummary = {
encode(message: InboxSummary, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.hasUnread === true) {
- writer.uint32(8).bool(message.hasUnread);
+ if (message.unread !== 0) {
+ writer.uint32(8).int32(message.unread);
}
- if (message.hasUnreadError === true) {
- writer.uint32(16).bool(message.hasUnreadError);
+ if (message.unreadError !== 0) {
+ writer.uint32(16).int32(message.unreadError);
}
return writer;
},
@@ -490,14 +490,14 @@ export const InboxSummary = {
break;
}
- message.hasUnread = reader.bool();
+ message.unread = reader.int32();
continue;
case 2:
if (tag !== 16) {
break;
}
- message.hasUnreadError = reader.bool();
+ message.unreadError = reader.int32();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -510,15 +510,15 @@ export const InboxSummary = {
fromJSON(object: any): InboxSummary {
return {
- hasUnread: isSet(object.hasUnread) ? Boolean(object.hasUnread) : false,
- hasUnreadError: isSet(object.hasUnreadError) ? Boolean(object.hasUnreadError) : false,
+ unread: isSet(object.unread) ? Number(object.unread) : 0,
+ unreadError: isSet(object.unreadError) ? Number(object.unreadError) : 0,
};
},
toJSON(message: InboxSummary): unknown {
const obj: any = {};
- message.hasUnread !== undefined && (obj.hasUnread = message.hasUnread);
- message.hasUnreadError !== undefined && (obj.hasUnreadError = message.hasUnreadError);
+ message.unread !== undefined && (obj.unread = Math.round(message.unread));
+ message.unreadError !== undefined && (obj.unreadError = Math.round(message.unreadError));
return obj;
},
@@ -528,8 +528,8 @@ export const InboxSummary = {
fromPartial(object: DeepPartial<InboxSummary>): InboxSummary {
const message = createBaseInboxSummary();
- message.hasUnread = object.hasUnread ?? false;
- message.hasUnreadError = object.hasUnreadError ?? false;
+ message.unread = object.unread ?? 0;
+ message.unreadError = object.unreadError ?? 0;
return message;
},
};
diff --git a/frontend/src/views/DashboardHeader.vue b/frontend/src/views/DashboardHeader.vue
index 35326c74d5..e2efcdc082 100644
--- a/frontend/src/views/DashboardHeader.vue
+++ b/frontend/src/views/DashboardHeader.vue
@@ -119,7 +119,7 @@
</div>
<router-link to="/inbox" exact-active-class="">
<span
- v-if="inboxSummary.hasUnread"
+ v-if="inboxSummary.unread > 0"
class="absolute rounded-full ml-4 -mt-1 h-2.5 w-2.5 bg-accent opacity-75"
></span>
<heroicons-outline:bell class="w-6 h-6" />
diff --git a/frontend/src/views/Inbox.vue b/frontend/src/views/Inbox.vue
index 1405509327..3eb1395437 100644
--- a/frontend/src/views/Inbox.vue
+++ b/frontend/src/views/Inbox.vue
@@ -91,26 +91,18 @@ export default {
watchEffect(prepareInboxList);
- const markAllAsRead = () => {
- let count = state.unreadList.length;
- const inboxList = state.unreadList.map((item) => item);
-
- inboxList.forEach((item) => {
- item.status = InboxMessage_Status.STATUS_READ;
- inboxV1Store.patchInbox(item).then(() => {
- const i = state.unreadList.findIndex(
- (unreadItem) => unreadItem.name == item.name
- );
- if (i >= 0) {
- state.unreadList.splice(i, 1);
- }
- count--;
- if (count == 0) {
- inboxV1Store.fetchInboxSummary();
- }
- state.readList.push(item);
- });
- });
+ const markAllAsRead = async () => {
+ const list = await Promise.all(
+ state.unreadList.map(async (item) => {
+ item.status = InboxMessage_Status.STATUS_READ;
+ // TODO: use batch instead.
+ await inboxV1Store.patchInbox(item);
+ return item;
+ })
+ );
+ state.readList.push(...list);
+ state.unreadList = [];
+ await inboxV1Store.fetchInboxSummary();
};
const viewOlder = () => {
diff --git a/frontend/src/views/sql-editor/EditorHeader.vue b/frontend/src/views/sql-editor/EditorHeader.vue
index 5e6e978bfb..22211689aa 100644
--- a/frontend/src/views/sql-editor/EditorHeader.vue
+++ b/frontend/src/views/sql-editor/EditorHeader.vue
@@ -31,7 +31,7 @@
<div class="flex items-center space-x-3">
<router-link to="/inbox">
<span
- v-if="inboxSummary.hasUnread"
+ v-if="inboxSummary.unread > 0"
class="absolute rounded-full ml-4 -mt-1 h-2.5 w-2.5 bg-accent opacity-75"
></span>
<heroicons-outline:bell class="w-6 h-6" />
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index b071e140c0..2278697104 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -3850,8 +3850,8 @@ The identity provider&#39;s `name` field is used to identify the identity provid
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| has_unread | [bool](#bool) | | |
-| has_unread_error | [bool](#bool) | | |
+| unread | [int32](#int32) | | |
+| unread_error | [int32](#int32) | | |
diff --git a/proto/generated-go/v1/inbox_service.pb.go b/proto/generated-go/v1/inbox_service.pb.go
index 3f0fdab50d..ff6f00ed2e 100644
--- a/proto/generated-go/v1/inbox_service.pb.go
+++ b/proto/generated-go/v1/inbox_service.pb.go
@@ -368,8 +368,8 @@ type InboxSummary struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- HasUnread bool `protobuf:"varint,1,opt,name=has_unread,json=hasUnread,proto3" json:"has_unread,omitempty"`
- HasUnreadError bool `protobuf:"varint,2,opt,name=has_unread_error,json=hasUnreadError,proto3" json:"has_unread_error,omitempty"`
+ Unread int32 `protobuf:"varint,1,opt,name=unread,proto3" json:"unread,omitempty"`
+ UnreadError int32 `protobuf:"varint,2,opt,name=unread_error,json=unreadError,proto3" json:"unread_error,omitempty"`
}
func (x *InboxSummary) Reset() {
@@ -404,18 +404,18 @@ func (*InboxSummary) Descriptor() ([]byte, []int) {
return file_v1_inbox_service_proto_rawDescGZIP(), []int{5}
}
-func (x *InboxSummary) GetHasUnread() bool {
+func (x *InboxSummary) GetUnread() int32 {
if x != nil {
- return x.HasUnread
+ return x.Unread
}
- return false
+ return 0
}
-func (x *InboxSummary) GetHasUnreadError() bool {
+func (x *InboxSummary) GetUnreadError() int32 {
if x != nil {
- return x.HasUnreadError
+ return x.UnreadError
}
- return false
+ return 0
}
var File_v1_inbox_service_proto protoreflect.FileDescriptor
@@ -469,38 +469,37 @@ var file_v1_inbox_service_proto_rawDesc = []byte{
0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e,
0x52, 0x45, 0x41, 0x44, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53,
- 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x02, 0x22, 0x57, 0x0a, 0x0c, 0x49, 0x6e, 0x62, 0x6f, 0x78,
- 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x68, 0x61, 0x73, 0x5f, 0x75,
- 0x6e, 0x72, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x68, 0x61, 0x73,
- 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x68, 0x61, 0x73, 0x5f, 0x75, 0x6e,
- 0x72, 0x65, 0x61, 0x64, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08,
- 0x52, 0x0e, 0x68, 0x61, 0x73, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72,
- 0x32, 0xfc, 0x02, 0x0a, 0x0c, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
- 0x65, 0x12, 0x5d, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x1d,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73,
- 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74,
- 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82,
- 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x78,
- 0x12, 0x6c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x75, 0x6d, 0x6d,
- 0x61, 0x72, 0x79, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72,
- 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x75, 0x6d, 0x6d,
- 0x61, 0x72, 0x79, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x76, 0x31,
- 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x3a, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x9e,
- 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x1f,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64,
- 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
- 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e,
- 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x53, 0xda, 0x41, 0x19, 0x69,
- 0x6e, 0x62, 0x6f, 0x78, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2c, 0x75, 0x70, 0x64,
- 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x3a, 0x0d,
- 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x20, 0x2f,
- 0x76, 0x31, 0x2f, 0x7b, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
- 0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x2f, 0x2a, 0x7d, 0x42,
- 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f,
- 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x02, 0x22, 0x49, 0x0a, 0x0c, 0x49, 0x6e, 0x62, 0x6f, 0x78,
+ 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x6e, 0x72, 0x65, 0x61,
+ 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x12,
+ 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x45, 0x72, 0x72,
+ 0x6f, 0x72, 0x32, 0xfc, 0x02, 0x0a, 0x0c, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x65, 0x72, 0x76,
+ 0x69, 0x63, 0x65, 0x12, 0x5d, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78,
+ 0x12, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c,
+ 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
+ 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69,
+ 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
+ 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x62,
+ 0x6f, 0x78, 0x12, 0x6c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x75,
+ 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x75, 0x6d, 0x6d,
+ 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x75,
+ 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f,
+ 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x3a, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79,
+ 0x12, 0x9e, 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78,
+ 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x53, 0xda, 0x41,
+ 0x19, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2c, 0x75,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31,
+ 0x3a, 0x0d, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32,
+ 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x5f, 0x6d, 0x65, 0x73, 0x73,
+ 0x61, 0x67, 0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x2f, 0x2a,
+ 0x7d, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67,
+ 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/proto/v1/inbox_service.proto b/proto/v1/inbox_service.proto
index 1007bd23a3..dd65d4ff6c 100644
--- a/proto/v1/inbox_service.proto
+++ b/proto/v1/inbox_service.proto
@@ -81,7 +81,7 @@ message InboxMessage {
}
message InboxSummary {
- bool has_unread = 1;
+ int32 unread = 1;
- bool has_unread_error = 2;
+ int32 unread_error = 2;
}