Skip to content

Commit 8bbc703

Browse files
chore: remove development logs and update screenshots
1 parent 59e55d1 commit 8bbc703

File tree

11 files changed

+16
-51
lines changed

11 files changed

+16
-51
lines changed

assets/02_home.png

5.62 KB
Loading

assets/02_home_mobile.png

-1.47 KB
Loading

assets/03_home.png

16.3 KB
Loading

backend/controllers/app_handlers.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ func (a *App) OAuthHandler(w http.ResponseWriter, r *http.Request) {
4444
// @Failure 500 {string} string "Internal server error"
4545
// @Router /auth/callback [get]
4646
func (a *App) OAuthCallbackHandler(w http.ResponseWriter, r *http.Request) {
47-
utils.Logger.Info("Fetching user info...")
48-
4947
code := r.URL.Query().Get("code")
5048

5149
t, err := a.Config.Exchange(context.Background(), code)
@@ -86,8 +84,6 @@ func (a *App) OAuthCallbackHandler(w http.ResponseWriter, r *http.Request) {
8684
return
8785
}
8886

89-
// utils.Logger.Infof("User Info: %v", userInfo)
90-
9187
frontendOriginDev := os.Getenv("FRONTEND_ORIGIN_DEV")
9288
http.Redirect(w, r, frontendOriginDev+"/home", http.StatusSeeOther)
9389
}
@@ -109,7 +105,6 @@ func (a *App) UserInfoHandler(w http.ResponseWriter, r *http.Request) {
109105
return
110106
}
111107

112-
// utils.Logger.Infof("Sending User Info: %v", userInfo)
113108
w.Header().Set("Content-Type", "application/json")
114109
json.NewEncoder(w).Encode(userInfo)
115110
}
@@ -147,5 +142,4 @@ func (a *App) LogoutHandler(w http.ResponseWriter, r *http.Request) {
147142
}
148143

149144
w.WriteHeader(http.StatusOK)
150-
// utils.Logger.Info("User has logged out")
151145
}

backend/controllers/job_queue.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package controllers
22

33
import (
44
"sync"
5-
6-
"ccsync_backend/utils"
75
)
86

97
type Job struct {
@@ -37,23 +35,18 @@ func (q *JobQueue) AddJob(job Job) {
3735

3836
func (q *JobQueue) processJobs() {
3937
for job := range q.jobChannel {
40-
utils.Logger.Infof("Executing job: %s", job.Name)
41-
4238
go BroadcastJobStatus(JobStatus{
4339
Job: job.Name,
4440
Status: "in-progress",
4541
})
4642

4743
if err := job.Execute(); err != nil {
48-
utils.Logger.Errorf("Error executing job %s: %v", job.Name, err)
49-
5044
go BroadcastJobStatus(JobStatus{
5145
Job: job.Name,
5246
Status: "failure",
5347
})
5448
} else {
55-
utils.Logger.Infof("Success in executing job %s", job.Name)
56-
49+
// utils.Logger.Infof("Success in executing job %s", job.Name)
5750
go BroadcastJobStatus(JobStatus{
5851
Job: job.Name,
5952
Status: "success",

backend/controllers/websocket.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,25 @@ func WebSocketHandler(w http.ResponseWriter, r *http.Request) {
3131
defer ws.Close()
3232

3333
clients[ws] = true
34-
utils.Logger.Info("New WebSocket connection established!")
35-
3634
for {
3735
_, _, err := ws.ReadMessage()
3836
if err != nil {
3937
delete(clients, ws)
40-
utils.Logger.Info("WebSocket connection closed:", err)
4138
break
4239
}
4340
}
4441
}
4542

4643
func BroadcastJobStatus(jobStatus JobStatus) {
47-
utils.Logger.Infof("Broadcasting: %+v", jobStatus)
4844
broadcast <- jobStatus
4945
}
5046

5147
func JobStatusManager() {
5248
for {
5349
jobStatus := <-broadcast
54-
utils.Logger.Infof("Sending to clients: %+v", jobStatus)
5550
for client := range clients {
5651
err := client.WriteJSON(jobStatus)
5752
if err != nil {
58-
utils.Logger.Errorf("WebSocket Write Error: %v", err)
5953
client.Close()
6054
delete(clients, client)
6155
}

frontend/src/components/HomeComponents/Navbar/navbar-utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ export const deleteAllTasks = async (props: Props) => {
9090
pauseOnHover: true,
9191
draggable: true,
9292
});
93-
94-
console.log(`Deleted ${taskCount} tasks for email: ${props.email}`);
9593
} catch (error) {
9694
toast.update(loadingToastId, {
9795
render: `Error deleting tasks for ${props.email}: ${error}`,

frontend/src/components/HomeComponents/Tasks/Tasks.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ export const Tasks = (
253253
UUID,
254254
backendURL: url.backendURL,
255255
});
256-
console.log(taskwarriorTasks);
257256

258257
await db.transaction('rw', db.tasks, async () => {
259258
await db.tasks.where('email').equals(user_email).delete();
@@ -314,7 +313,6 @@ export const Tasks = (
314313
backendURL: url.backendURL,
315314
});
316315

317-
console.log('Task added successfully!');
318316
setNewTask({
319317
description: '',
320318
priority: '',
@@ -372,7 +370,6 @@ export const Tasks = (
372370
annotations,
373371
});
374372

375-
console.log('Task edited successfully!');
376373
setIsAddTaskOpen(false);
377374
} catch (error) {
378375
console.error('Failed to edit task:', error);
@@ -808,7 +805,6 @@ export const Tasks = (
808805
const updatedTags = editedTags.filter((tag) => tag.trim() !== '');
809806
const tagsToRemove = removedTags.map((tag) => `${tag}`);
810807
const finalTags = [...updatedTags, ...tagsToRemove];
811-
console.log(finalTags);
812808

813809
setUnsyncedTaskUuids((prev) => new Set([...prev, task.uuid]));
814810

@@ -872,7 +868,6 @@ export const Tasks = (
872868
backendURL: url.backendURL,
873869
});
874870

875-
console.log('Priority updated successfully!');
876871
toast.success('Priority updated successfully!');
877872
} catch (error) {
878873
console.error('Failed to update priority:', error);

frontend/src/components/HomeComponents/Tasks/tasks-utils.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ export const markTaskAsCompleted = async (
3737
}),
3838
});
3939

40-
if (response) {
41-
console.log('Task marked as completed successfully!');
42-
} else {
40+
if (!response) {
4341
console.error('Failed to mark task as completed');
4442
}
4543
} catch (error) {
@@ -70,9 +68,10 @@ export const bulkMarkTasksAsCompleted = async (
7068
});
7169

7270
if (response.ok) {
73-
console.log('Bulk completion successful!');
7471
toast.success(
75-
`${taskUUIDs.length} ${taskUUIDs.length === 1 ? 'task' : 'tasks'} marked as completed.`
72+
`${taskUUIDs.length} ${
73+
taskUUIDs.length === 1 ? 'task' : 'tasks'
74+
} marked as completed.`
7675
);
7776
return true;
7877
} else {
@@ -110,9 +109,10 @@ export const bulkMarkTasksAsDeleted = async (
110109
});
111110

112111
if (response.ok) {
113-
console.log('Bulk deletion successful!');
114112
toast.success(
115-
`${taskUUIDs.length} ${taskUUIDs.length === 1 ? 'task' : 'tasks'} deleted.`
113+
`${taskUUIDs.length} ${
114+
taskUUIDs.length === 1 ? 'task' : 'tasks'
115+
} deleted.`
116116
);
117117
return true;
118118
} else {
@@ -146,9 +146,7 @@ export const markTaskAsDeleted = async (
146146
}),
147147
});
148148

149-
if (response) {
150-
console.log('Task marked as deleted successfully!');
151-
} else {
149+
if (!response) {
152150
console.error('Failed to mark task as deleted');
153151
}
154152
} catch (error) {
@@ -267,9 +265,13 @@ export const getTimeSinceLastSync = (
267265
const diffDays = Math.floor(diffHours / 24);
268266

269267
if (diffSeconds < 60) {
270-
return `Last updated ${diffSeconds} second${diffSeconds !== 1 ? 's' : ''} ago`;
268+
return `Last updated ${diffSeconds} second${
269+
diffSeconds !== 1 ? 's' : ''
270+
} ago`;
271271
} else if (diffMinutes < 60) {
272-
return `Last updated ${diffMinutes} minute${diffMinutes !== 1 ? 's' : ''} ago`;
272+
return `Last updated ${diffMinutes} minute${
273+
diffMinutes !== 1 ? 's' : ''
274+
} ago`;
273275
} else if (diffHours < 24) {
274276
return `Last updated ${diffHours} hour${diffHours !== 1 ? 's' : ''} ago`;
275277
} else {

frontend/src/components/HomePage.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,21 @@ export const HomePage: React.FC = () => {
5555

5656
useEffect(() => {
5757
if (!userInfo || !userInfo.uuid) {
58-
console.log(
59-
'User info or UUID is not available yet, skipping WebSocket setup.'
60-
);
6158
return;
6259
}
6360

6461
if (userInfo.email && userInfo.encryption_secret && userInfo.uuid) {
6562
getTasks(userInfo.email, userInfo.encryption_secret, userInfo.uuid);
6663
}
6764

68-
console.log('Setting up WebSocket with clientID:', userInfo.uuid);
6965
const socketURL = `${url.backendURL.replace(/^http/, 'ws')}ws?clientID=${
7066
userInfo.uuid
7167
}`;
7268
const socket = new WebSocket(socketURL);
7369

74-
socket.onopen = () => console.log('WebSocket connected!');
70+
// socket.onopen = () => console.log('WebSocket connected!');
7571

7672
socket.onmessage = (event) => {
77-
// console.log("Message received:", event.data);
7873
try {
7974
const data = JSON.parse(event.data);
8075
if (data.status === 'success') {
@@ -84,7 +79,6 @@ export const HomePage: React.FC = () => {
8479
}
8580

8681
if (data.job === 'Add Task') {
87-
console.log('Task added successfully');
8882
toast.success('Task added successfully!', {
8983
position: 'bottom-left',
9084
autoClose: 3000,
@@ -95,7 +89,6 @@ export const HomePage: React.FC = () => {
9589
progress: undefined,
9690
});
9791
} else if (data.job === 'Edit Task') {
98-
console.log('Task edited successfully');
9992
toast.success('Task edited successfully!', {
10093
position: 'bottom-left',
10194
autoClose: 3000,
@@ -127,7 +120,6 @@ export const HomePage: React.FC = () => {
127120
});
128121
}
129122
} else if (data.status == 'failure') {
130-
console.log(`Failed to ${data.job || 'perform action'}`);
131123
toast.error(`Failed to ${data.job || 'perform action'}`, {
132124
position: 'bottom-left',
133125
autoClose: 3000,
@@ -147,7 +139,6 @@ export const HomePage: React.FC = () => {
147139
socket.onerror = (error) => console.error('WebSocket error:', error);
148140

149141
return () => {
150-
console.log('Cleaning up WebSocket...');
151142
socket.close();
152143
};
153144
}, [userInfo]);

0 commit comments

Comments
 (0)