Fix: Hinzufügen von Protokollausgaben zur Fehlerdiagnose in FalukantController und FalukantService
Änderung: - In der Klasse FalukantController wurden Protokollausgaben hinzugefügt, um die Aufrufe der Methoden getDirectorProposals und getGifts zu verfolgen. - In der Klasse FalukantService wurde eine Protokollausgabe hinzugefügt, um die Aufrufe der Methode getFalukantUserByHashedId zu dokumentieren und das Ergebnis zu protokollieren. Diese Anpassung verbessert die Nachvollziehbarkeit der Methodenaufrufe und erleichtert die Fehlersuche im Backend.
This commit is contained in:
@@ -69,7 +69,10 @@ class FalukantController {
|
|||||||
this.getStockOverview = this._wrapSimple(() => this.service.getStockOverview());
|
this.getStockOverview = this._wrapSimple(() => this.service.getStockOverview());
|
||||||
this.getAllProductions = this._wrapWithUser((userId) => this.service.getAllProductions(userId));
|
this.getAllProductions = this._wrapWithUser((userId) => this.service.getAllProductions(userId));
|
||||||
|
|
||||||
this.getDirectorProposals = this._wrapWithUser((userId, req) => this.service.getDirectorProposals(userId, req.body.branchId));
|
this.getDirectorProposals = this._wrapWithUser((userId, req) => {
|
||||||
|
console.log('🔍 getDirectorProposals called with userId:', userId, 'branchId:', req.body.branchId);
|
||||||
|
return this.service.getDirectorProposals(userId, req.body.branchId);
|
||||||
|
});
|
||||||
this.convertProposalToDirector = this._wrapWithUser((userId, req) => this.service.convertProposalToDirector(userId, req.body.proposalId));
|
this.convertProposalToDirector = this._wrapWithUser((userId, req) => this.service.convertProposalToDirector(userId, req.body.proposalId));
|
||||||
this.getDirectorForBranch = this._wrapWithUser((userId, req) => this.service.getDirectorForBranch(userId, req.params.branchId));
|
this.getDirectorForBranch = this._wrapWithUser((userId, req) => this.service.getDirectorForBranch(userId, req.params.branchId));
|
||||||
this.getAllDirectors = this._wrapWithUser((userId) => this.service.getAllDirectors(userId));
|
this.getAllDirectors = this._wrapWithUser((userId) => this.service.getAllDirectors(userId));
|
||||||
@@ -89,7 +92,10 @@ class FalukantController {
|
|||||||
return result;
|
return result;
|
||||||
});
|
});
|
||||||
this.acceptMarriageProposal = this._wrapWithUser((userId, req) => this.service.acceptMarriageProposal(userId, req.body.proposalId));
|
this.acceptMarriageProposal = this._wrapWithUser((userId, req) => this.service.acceptMarriageProposal(userId, req.body.proposalId));
|
||||||
this.getGifts = this._wrapWithUser((userId) => this.service.getGifts(userId));
|
this.getGifts = this._wrapWithUser((userId) => {
|
||||||
|
console.log('🔍 getGifts called with userId:', userId);
|
||||||
|
return this.service.getGifts(userId);
|
||||||
|
});
|
||||||
this.getChildren = this._wrapWithUser((userId) => this.service.getChildren(userId));
|
this.getChildren = this._wrapWithUser((userId) => this.service.getChildren(userId));
|
||||||
this.sendGift = this._wrapWithUser((userId, req) => this.service.sendGift(userId, req.body.giftId));
|
this.sendGift = this._wrapWithUser((userId, req) => this.service.sendGift(userId, req.body.giftId));
|
||||||
|
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ class FalukantService extends BaseService {
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
async getFalukantUserByHashedId(hashedId) {
|
async getFalukantUserByHashedId(hashedId) {
|
||||||
|
console.log('🔍 getFalukantUserByHashedId called with hashedId:', hashedId);
|
||||||
const user = await FalukantUser.findOne({
|
const user = await FalukantUser.findOne({
|
||||||
include: [
|
include: [
|
||||||
{ model: User, as: 'user', attributes: ['username', 'hashedId'], where: { hashedId } },
|
{ model: User, as: 'user', attributes: ['username', 'hashedId'], where: { hashedId } },
|
||||||
@@ -162,6 +163,7 @@ class FalukantService extends BaseService {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
console.log('🔍 getFalukantUserByHashedId result:', user ? 'User found' : 'User not found');
|
||||||
if (!user) throw new Error('User not found');
|
if (!user) throw new Error('User not found');
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,13 +132,14 @@ const store = createStore({
|
|||||||
console.log('🔌 Initializing Daemon WebSocket connection to:', daemonUrl);
|
console.log('🔌 Initializing Daemon WebSocket connection to:', daemonUrl);
|
||||||
console.log('🔌 Protocol:', 'yourpart-protocol');
|
console.log('🔌 Protocol:', 'yourpart-protocol');
|
||||||
try {
|
try {
|
||||||
// Versuche zuerst mit Protokoll, dann ohne
|
// Versuche zuerst ohne Protokoll, da der Server es möglicherweise nicht unterstützt
|
||||||
let daemonSocket;
|
let daemonSocket;
|
||||||
try {
|
try {
|
||||||
daemonSocket = new WebSocket(daemonUrl, 'yourpart-protocol');
|
console.log('🔌 Trying WebSocket connection without protocol...');
|
||||||
} catch (protocolError) {
|
|
||||||
console.warn('⚠️ Protocol error, trying without protocol:', protocolError);
|
|
||||||
daemonSocket = new WebSocket(daemonUrl);
|
daemonSocket = new WebSocket(daemonUrl);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('❌ Failed to create WebSocket:', error);
|
||||||
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
daemonSocket.onopen = () => {
|
daemonSocket.onopen = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user