fixslow send
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "800733765231",
|
||||
"firebase_url": "https://gabinete-digital-2020.firebaseio.com",
|
||||
"project_id": "gabinete-digital-2020",
|
||||
"storage_bucket": "gabinete-digital-2020.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:800733765231:android:e7ffc0b310037d9f13779a",
|
||||
"android_client_info": {
|
||||
"package_name": "com.gpr.gabinetedigital"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "800733765231-92oa7ib62ob0pkouphb5i5sp01vkalid.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyD0pfW45DLoW6mqvZRklJdbfSTskW22Fok"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "800733765231-92oa7ib62ob0pkouphb5i5sp01vkalid.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<manifest package="com.gpr.gabinetedigital" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:requestLegacyExternalStorage="true" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
|
||||
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:exported="true" android:label="@string/title_activity_main" android:launchMode="singleTop" android:name=".MainActivity" android:theme="@style/AppTheme.NoActionBarLaunch">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:exported="true" android:label="@string/app_name" android:name="de.mindlib.sendIntent.SendIntentActivity" android:theme="@style/AppTheme.NoActionBar">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="image/*" />
|
||||
<data android:mimeType="video/*" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="image/*" />
|
||||
<data android:mimeType="video/*" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<provider android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
|
||||
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
</manifest>
|
||||
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 30 KiB |
@@ -0,0 +1,34 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="78.5885"
|
||||
android:endY="90.9159"
|
||||
android:startX="48.7653"
|
||||
android:startY="61.0927"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1" />
|
||||
</vector>
|
||||
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path
|
||||
android:fillColor="#26A69A"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
</vector>
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 12 KiB |
@@ -30,6 +30,9 @@ Java version 11
|
||||
ionic build &&
|
||||
npx cap add android &&
|
||||
npx cap update
|
||||
Gradle version 7.4.1
|
||||
Gradle SDK JDK 16.0.2
|
||||
|
||||
|
||||
## BUG
|
||||
|
||||
@@ -97,3 +100,4 @@ git tag stable
|
||||
For major changes, please open an issue first to discuss what you would like to change.
|
||||
|
||||
Please make sure to update tests as appropriate.
|
||||
|
||||
|
||||
@@ -106,78 +106,96 @@ export class MessageCreateUseCaseService {
|
||||
message.sendAttemp++;
|
||||
|
||||
message.requestId = InstanceId +'@'+ uuidv4();
|
||||
message.sending = true;
|
||||
|
||||
const createMessageLocally = await this.messageLocalDataSourceService.insert(message)
|
||||
const createMessageLocally = this.messageLocalDataSourceService.insert(message)
|
||||
|
||||
if(createMessageLocally.isOk()) {
|
||||
createMessageLocally.then((value) => {
|
||||
if(value.isOk()) {
|
||||
|
||||
message.$id = createMessageLocally.value
|
||||
console.log("set image")
|
||||
message.$id = value.value
|
||||
|
||||
if(message.hasAttachment) {
|
||||
if(message.hasAttachment) {
|
||||
|
||||
for (const attachment of message.attachments) {
|
||||
for (const attachment of message.attachments) {
|
||||
|
||||
if(attachment.source != MessageAttachmentSource.Webtrix) {
|
||||
if(attachment.source != MessageAttachmentSource.Webtrix) {
|
||||
|
||||
this.AttachmentLocalRepositoryService.insert({
|
||||
$messageId: createMessageLocally.value,
|
||||
file: createBlobFromBase64(attachment.file, attachment.mimeType),
|
||||
fileType: attachment.fileType,
|
||||
source: attachment.source,
|
||||
fileName: attachment.fileName,
|
||||
applicationId: attachment.applicationId,
|
||||
docId: attachment.docId,
|
||||
mimeType: attachment.mimeType,
|
||||
base64: createDataURL(attachment.file, attachment.mimeType)
|
||||
}).then((e) => {
|
||||
if(e.isErr()) {
|
||||
Logger.error('failed to create attachment locally on send message', {
|
||||
error: e.error,
|
||||
data: createDataURL(attachment.file, attachment.mimeType).slice(0, 100) +'...'
|
||||
})
|
||||
}
|
||||
this.AttachmentLocalRepositoryService.insert({
|
||||
$messageId: value.value,
|
||||
file: createBlobFromBase64(attachment.file, attachment.mimeType),
|
||||
fileType: attachment.fileType,
|
||||
source: attachment.source,
|
||||
fileName: attachment.fileName,
|
||||
applicationId: attachment.applicationId,
|
||||
docId: attachment.docId,
|
||||
mimeType: attachment.mimeType,
|
||||
base64: createDataURL(attachment.file, attachment.mimeType)
|
||||
}).then((e) => {
|
||||
if(e.isErr()) {
|
||||
Logger.error('failed to create attachment locally on send message', {
|
||||
error: e.error,
|
||||
data: createDataURL(attachment.file, attachment.mimeType).slice(0, 100) +'...'
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
attachment.safeFile = createDataURL(attachment.file, attachment.mimeType)
|
||||
attachment.safeFile = createDataURL(attachment.file, attachment.mimeType)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//====================
|
||||
message.sending = true
|
||||
|
||||
let sendMessageResult: Result<MessageOutPutDataDTO, any>
|
||||
if(messageEnum == RoomType.Group) {
|
||||
const DTO = MessageMapper.fromDomain(message, message.requestId)
|
||||
sendMessageResult = await this.messageSocketRepositoryService.sendGroupMessage(DTO)
|
||||
} else {
|
||||
const DTO = MessageMapper.fromDomain(message, message.requestId)
|
||||
delete DTO.roomId
|
||||
sendMessageResult = await this.messageSocketRepositoryService.sendDirectMessage(DTO)
|
||||
Logger.error('failed to insert locally', {
|
||||
error: value.error.message
|
||||
})
|
||||
}
|
||||
|
||||
// return this sendMessageResult
|
||||
});
|
||||
|
||||
if(sendMessageResult.isOk()) {
|
||||
//====================
|
||||
message.sending = true
|
||||
|
||||
message.id = sendMessageResult.value.id
|
||||
let sendMessageResult!: Result<MessageOutPutDataDTO, any>
|
||||
const start = performance.now(); // Capture the start time
|
||||
if(messageEnum == RoomType.Group) {
|
||||
const DTO = MessageMapper.fromDomain(message, message.requestId)
|
||||
sendMessageResult = await this.messageSocketRepositoryService.sendGroupMessage(DTO)
|
||||
} else {
|
||||
const DTO = MessageMapper.fromDomain(message, message.requestId)
|
||||
delete DTO.roomId
|
||||
sendMessageResult = await this.messageSocketRepositoryService.sendDirectMessage(DTO)
|
||||
}
|
||||
|
||||
console.log('sendMessageResult', sendMessageResult.value.id)
|
||||
const end = performance.now(); // Capture the end time
|
||||
const duration = end - start; // Calculate the difference
|
||||
|
||||
if(sendMessageResult.value.sender == undefined || sendMessageResult.value.sender == null) {
|
||||
tracing.setAttribute("duration", `Execution time: ${duration}ms`);
|
||||
|
||||
delete sendMessageResult.value.sender
|
||||
}
|
||||
// return this sendMessageResult
|
||||
|
||||
if(sendMessageResult.isOk()) {
|
||||
|
||||
message.id = sendMessageResult.value.id
|
||||
|
||||
console.log('sendMessageResult', sendMessageResult.value.id)
|
||||
|
||||
if(sendMessageResult.value.sender == undefined || sendMessageResult.value.sender == null) {
|
||||
|
||||
delete sendMessageResult.value.sender
|
||||
}
|
||||
|
||||
createMessageLocally.then((value) => {
|
||||
console.log('sendMessageResult', (sendMessageResult as any).value)
|
||||
let clone: MessageTable = {
|
||||
...sendMessageResult.value,
|
||||
id: sendMessageResult.value.id,
|
||||
...(sendMessageResult as any).value,
|
||||
id: (sendMessageResult as any).value.id,
|
||||
$id : message.$id
|
||||
}
|
||||
|
||||
console.log('set update')
|
||||
this.messageLocalDataSourceService.update(message.$id, {...clone, sending: false, roomId: clone.roomId}).then((data)=> {
|
||||
if(data.isOk()) {
|
||||
|
||||
@@ -187,20 +205,16 @@ export class MessageCreateUseCaseService {
|
||||
console.log(data.error)
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
return sendMessageResult
|
||||
} else {
|
||||
Logger.error('failed to send message to the server', {
|
||||
error: sendMessageResult.error
|
||||
})
|
||||
await this.messageLocalDataSourceService.update(message.$id, {sending: false, $id: message.$id})
|
||||
return err('no connection')
|
||||
}
|
||||
|
||||
return sendMessageResult
|
||||
} else {
|
||||
Logger.error('failed to insert locally', {
|
||||
error: createMessageLocally.error.message
|
||||
Logger.error('failed to send message to the server', {
|
||||
error: sendMessageResult.error
|
||||
})
|
||||
await this.messageLocalDataSourceService.update(message.$id, {sending: false, $id: message.$id})
|
||||
return err('no connection')
|
||||
}
|
||||
} else {
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@ import { ValidateSchema } from 'src/app/services/decorators/validate-schema.deco
|
||||
import { MessageRemoteDataSourceService } from '../../../../module/chat/data/repository/message/message-remote-data-source.service';
|
||||
import { MessageSocketRepositoryService } from '../../../../module/chat/data/repository/message/message-live-signalr-data-source.service';
|
||||
import { IMessageSocketRepository } from '../../repository/message/message-socket-repository';
|
||||
import { zodSafeValidation } from 'src/app/utils/zodValidation';
|
||||
import { Logger } from 'src/app/services/logger/main/service';
|
||||
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||
|
||||
|
||||
const MessageUpdateInputDTOSchema = z.object({
|
||||
@@ -26,9 +29,23 @@ export class MessageUpdateUseCaseService {
|
||||
public repository: IMessageSocketRepository
|
||||
) { }
|
||||
|
||||
@ValidateSchema(MessageUpdateInputDTOSchema)
|
||||
execute(input: MessageUpdateInput) {
|
||||
return this.repository.updateMessage(input);
|
||||
|
||||
@XTracerAsync({name:'MessageUpdateUseCaseService', module:'chat', bugPrint: true, waitNThrow: 5000})
|
||||
async execute(input: MessageUpdateInput, tracing?: TracingType) {
|
||||
console.log('MessageUpdateUseCaseService', input)
|
||||
const validation = zodSafeValidation<MessageUpdateInput>(MessageUpdateInputDTOSchema, input)
|
||||
|
||||
if(validation.isOk()) {
|
||||
|
||||
} else {
|
||||
tracing.hasError('failed to update message, validation failed')
|
||||
Logger.error('failed to update message, validation failed', {
|
||||
zodErrorList: validation.error.errors,
|
||||
data: input
|
||||
})
|
||||
}
|
||||
|
||||
return await this.repository.updateMessage(input);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export class HttpService {
|
||||
|
||||
const httpOptions = {
|
||||
params: httpParams,
|
||||
headers: options?.headers || new HttpHeaders(),
|
||||
headers: options?.headers as any || new HttpHeaders(),
|
||||
responseType: options?.responseType || 'json' as any,
|
||||
};
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ export function APIReturn(schema: z.ZodTypeAny, path: string) {
|
||||
tracing?.setAttribute?.('map.error.schema-'+i, JSON.stringify(schema))
|
||||
}
|
||||
|
||||
tracing.log('API return '+ path, {
|
||||
tracing?.log?.('API return '+ path, {
|
||||
data: result?.value,
|
||||
issues: error?.errors
|
||||
})
|
||||
@@ -79,7 +79,7 @@ export function APINODReturn(schema: z.ZodTypeAny, data , path: string, tracing?
|
||||
tracing?.setAttribute('map.error.schema-'+i, JSON.stringify(schema))
|
||||
}
|
||||
|
||||
tracing?.log('API return '+ path, {
|
||||
tracing?.log?.('API return '+ path, {
|
||||
data,
|
||||
issues: error?.errors
|
||||
})
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<button *ngIf="roomType == EnumRoomType.Group" (click)="leaveGroup()" class="btn-cancel mt-10-em" shape="round">Sair do Grupo</button>
|
||||
<button *ngIf="isAdmin && roomType == EnumRoomType.Group" (click)="openChangeGroupName()" class="btn-cancel btn-cancel mt-10" shape="round" style="min-width: 192px;">Alterar
|
||||
nome do grupo</button>
|
||||
<button *ngIf="isAdmin && roomType == EnumRoomType.Group" (click)="setRoomOwner()" class="btn-cancel mt-10-em" shape="round">Adicionar admin</button>
|
||||
<button *ngIf="isAdmin && roomType == EnumRoomType.Group" (click)="setRoomOwner({})" class="btn-cancel mt-10-em" shape="round">Adicionar administrador</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="close('cancel')" full class="btn-cancel mobile-only mt-10-em" shape="round">Cancelar</button>
|
||||
<button (click)="deleteGroup()" class="btn-delete mt-10-em" shape="round">Apagar grupo</button>
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { SetRoomOwnerPage } from 'src/app/ui/chat/modal/set-room-owner/set-room-owner.page';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { ZodError } from 'zod';
|
||||
import { MemberListLocalRepository } from 'src/app/module/chat/data/repository/member/member-list-local-repository.service'
|
||||
import { MemberListLocalRepository } from 'src/app/module/chat/data/repository/member/member-list-local-repository.service';
|
||||
import { ChatServiceService } from 'src/app/module/chat/domain/chat-service.service'
|
||||
import { RoomInfoPage } from '../room-info/room-info.page';
|
||||
import { RoomType } from 'src/app/core/chat/entity/group';
|
||||
import { isHttpResponse } from 'src/app/infra/http/http.service';
|
||||
|
||||
|
||||
|
||||
interface ISetRoomOwner {
|
||||
addAdminBeforeLeave: null | boolean
|
||||
addAdminBeforeLeave?: null | boolean
|
||||
}
|
||||
|
||||
@Component({
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
export let versionData = {
|
||||
"shortSHA": "aef73625f",
|
||||
"SHA": "aef73625f081830c368591d90bc09f12a31d7fef",
|
||||
"shortSHA": "18a8d90d9",
|
||||
"SHA": "18a8d90d99923c440618cbee806879ee131bca03",
|
||||
"branch": "feature/login-v2",
|
||||
"lastCommitAuthor": "'Peter Maquiran'",
|
||||
"lastCommitTime": "'Fri Dec 6 11:21:32 2024 +0100'",
|
||||
"lastCommitMessage": "fix errors",
|
||||
"lastCommitNumber": "6135",
|
||||
"changeStatus": "On branch feature/login-v2\nYour branch is up to date with 'origin/feature/login-v2'.\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tdeleted: android/app/google-services.json\n\tdeleted: android/app/src/main/AndroidManifest.xml\n\tdeleted: android/app/src/main/res/drawable-land-hdpi/splash.png\n\tdeleted: android/app/src/main/res/drawable-land-ldpi/splash.png\n\tdeleted: android/app/src/main/res/drawable-land-mdpi/splash.png\n\tdeleted: android/app/src/main/res/drawable-land-xhdpi/splash.png\n\tdeleted: android/app/src/main/res/drawable-land-xxhdpi/splash.png\n\tdeleted: android/app/src/main/res/drawable-land-xxxhdpi/splash.png\n\tdeleted: android/app/src/main/res/drawable-port-hdpi/splash.png\n\tdeleted: android/app/src/main/res/drawable-port-ldpi/splash.png\n\tdeleted: android/app/src/main/res/drawable-port-mdpi/splash.png\n\tdeleted: android/app/src/main/res/drawable-port-xhdpi/splash.png\n\tdeleted: android/app/src/main/res/drawable-port-xxhdpi/splash.png\n\tdeleted: android/app/src/main/res/drawable-port-xxxhdpi/splash.png\n\tdeleted: android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml\n\tdeleted: android/app/src/main/res/drawable/ic_launcher_background.xml\n\tdeleted: android/app/src/main/res/drawable/splash.png\n\tdeleted: android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml\n\tdeleted: android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml\n\tdeleted: android/app/src/main/res/mipmap-hdpi/ic_launcher.png\n\tdeleted: android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png\n\tdeleted: android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png\n\tdeleted: android/app/src/main/res/mipmap-mdpi/ic_launcher.png\n\tdeleted: android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png\n\tdeleted: android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png\n\tdeleted: android/app/src/main/res/mipmap-xhdpi/ic_launcher.png\n\tdeleted: android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png\n\tdeleted: android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png\n\tdeleted: android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png\n\tdeleted: android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png\n\tdeleted: android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png\n\tdeleted: android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png\n\tdeleted: android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png\n\tdeleted: android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png\n\tmodified: src/app/core/chat/entity/message.ts\n\tnew file: src/app/core/chat/usecase/message/message-create-use-case.service copy.ts\n\tmodified: src/app/core/notification/use-case/notification-delete-all-use-case.service.ts\n\tmodified: src/app/index/index-routing.module.ts\n\tmodified: src/app/infra/database/dexie/instance/chat/service.ts\n\tmodified: src/app/modals/profile/profile.page.html\n\tmodified: src/app/modals/profile/profile.page.scss\n\tmodified: src/app/modals/profile/profile.page.ts\n\tmodified: src/app/module/notification/data/async/changes/notificationListChange.ts\n\tmodified: src/app/module/notification/data/datasource/local-notification.service.ts\n\tmodified: src/app/module/notification/data/datasource/remote-notification.service.ts\n\tmodified: src/app/module/notification/data/dto/NotificationOutputDTO.ts\n\tmodified: src/app/module/notification/data/infra/db/notification.db.ts\n\tmodified: src/app/module/notification/data/notification-repository.service.ts\n\tmodified: src/app/module/notification/domain/mapper/notificationListMapper.ts\n\tmodified: src/app/module/notification/domain/notification.service.ts\n\tmodified: src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts\n\tmodified: src/app/ui/chat/component/group-contacts/group-contacts.page.ts\n\tmodified: src/app/ui/chat/component/messages/messages.page.html\n\tmodified: src/app/ui/chat/component/messages/messages.page.ts\n\tmodified: src/app/ui/chat/modal/chat-popover/chat-popover.page.ts\n\tmodified: src/app/ui/chat/modal/messages/messages.page.html\n\tmodified: src/app/ui/chat/modal/messages/messages.page.ts\n\tmodified: src/app/ui/chat/modal/set-room-owner/set-room-owner.page.ts\n\tmodified: src/app/ui/chat/store/model/message.ts",
|
||||
"lastCommitTime": "'Mon Dec 16 12:04:02 2024 +0100'",
|
||||
"lastCommitMessage": "notification and chat slow",
|
||||
"lastCommitNumber": "6136",
|
||||
"changeStatus": "On branch feature/login-v2\nYour branch is ahead of 'origin/feature/login-v2' by 1 commit.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tnew file: android/app/google-services.json\n\tnew file: android/app/src/main/AndroidManifest.xml\n\tnew file: android/app/src/main/res/drawable-land-hdpi/splash.png\n\tnew file: android/app/src/main/res/drawable-land-ldpi/splash.png\n\tnew file: android/app/src/main/res/drawable-land-mdpi/splash.png\n\tnew file: android/app/src/main/res/drawable-land-xhdpi/splash.png\n\tnew file: android/app/src/main/res/drawable-land-xxhdpi/splash.png\n\tnew file: android/app/src/main/res/drawable-land-xxxhdpi/splash.png\n\tnew file: android/app/src/main/res/drawable-port-hdpi/splash.png\n\tnew file: android/app/src/main/res/drawable-port-ldpi/splash.png\n\tnew file: android/app/src/main/res/drawable-port-mdpi/splash.png\n\tnew file: android/app/src/main/res/drawable-port-xhdpi/splash.png\n\tnew file: android/app/src/main/res/drawable-port-xxhdpi/splash.png\n\tnew file: android/app/src/main/res/drawable-port-xxxhdpi/splash.png\n\tnew file: android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml\n\tnew file: android/app/src/main/res/drawable/ic_launcher_background.xml\n\tnew file: android/app/src/main/res/drawable/splash.png\n\tnew file: android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml\n\tnew file: android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml\n\tnew file: android/app/src/main/res/mipmap-hdpi/ic_launcher.png\n\tnew file: android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png\n\tnew file: android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png\n\tnew file: android/app/src/main/res/mipmap-mdpi/ic_launcher.png\n\tnew file: android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png\n\tnew file: android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png\n\tnew file: android/app/src/main/res/mipmap-xhdpi/ic_launcher.png\n\tnew file: android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png\n\tnew file: android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png\n\tnew file: android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png\n\tnew file: android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png\n\tnew file: android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png\n\tnew file: android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png\n\tnew file: android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png\n\tnew file: android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png\n\tmodified: readme.md\n\tmodified: src/app/core/chat/usecase/message/message-create-use-case.service.ts\n\tmodified: src/app/core/chat/usecase/message/message-update-by-id-use-case.service.ts\n\tmodified: src/app/infra/http/http.service.ts\n\tmodified: src/app/services/decorator/api-validate-schema.decorator.ts\n\tmodified: src/app/ui/chat/modal/chat-popover/chat-popover.page.html\n\tmodified: src/app/ui/chat/modal/chat-popover/chat-popover.page.ts\n\tmodified: version/git-version.ts\n\nChanges not staged for commit:\n (use \"git add <file>...\" to update what will be committed)\n (use \"git restore <file>...\" to discard changes in working directory)\n\tmodified: src/app/core/chat/usecase/message/message-update-by-id-use-case.service.ts",
|
||||
"changeAuthor": "peter.maquiran"
|
||||
}
|
||||