From 5c85daa06c1c67641ee7cc42731890c1e4dfa6b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villaf=C3=A1=C3=B1ez?= Date: Fri, 22 Mar 2024 14:39:51 +0100 Subject: [PATCH] fix: remove some TODO messages --- services/collaboration/pkg/connector/contentconnector.go | 2 -- services/collaboration/pkg/connector/fileconnector.go | 7 +++++-- services/collaboration/pkg/helpers/discovery.go | 4 +--- services/collaboration/pkg/helpers/registration.go | 1 - 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/services/collaboration/pkg/connector/contentconnector.go b/services/collaboration/pkg/connector/contentconnector.go index 2bd16eaba1..f639c1f725 100644 --- a/services/collaboration/pkg/connector/contentconnector.go +++ b/services/collaboration/pkg/connector/contentconnector.go @@ -103,7 +103,6 @@ func (c *ContentConnector) GetFile(ctx context.Context, writer io.Writer) error // public link downloads have the token in the download endpoint httpReq.Header.Add("X-Reva-Transfer", downloadToken) } - // TODO: the access token shouldn't be needed httpReq.Header.Add("X-Access-Token", wopiContext.AccessToken) httpResp, err := httpClient.Do(httpReq) @@ -276,7 +275,6 @@ func (c *ContentConnector) PutFile(ctx context.Context, stream io.Reader, stream // public link uploads have the token in the upload endpoint httpReq.Header.Add("X-Reva-Transfer", uploadToken) } - // TODO: the access token shouldn't be needed httpReq.Header.Add("X-Access-Token", wopiContext.AccessToken) httpReq.Header.Add("X-Lock-Id", lockID) diff --git a/services/collaboration/pkg/connector/fileconnector.go b/services/collaboration/pkg/connector/fileconnector.go index bc6f07f370..534fb2fa8b 100644 --- a/services/collaboration/pkg/connector/fileconnector.go +++ b/services/collaboration/pkg/connector/fileconnector.go @@ -189,9 +189,12 @@ func (f *FileConnector) Lock(ctx context.Context, lockID, oldLockID string) (str return resp.GetLock().GetLockId(), nil } - // TODO: Is this the right error code? logger.Error().Msg("SetLock failed and could not refresh") - return "", NewConnectorError(404, "Could not refresh the lock") + return "", NewConnectorError(500, "Could not refresh the lock") + + case rpcv1beta1.Code_CODE_NOT_FOUND: + logger.Error().Msg("SetLock failed, file not found") + return "", NewConnectorError(404, "File not found") default: logger.Error(). diff --git a/services/collaboration/pkg/helpers/discovery.go b/services/collaboration/pkg/helpers/discovery.go index bbc388c932..1af71c0854 100644 --- a/services/collaboration/pkg/helpers/discovery.go +++ b/services/collaboration/pkg/helpers/discovery.go @@ -54,9 +54,7 @@ func GetAppURLs(cfg *config.Config, logger log.Logger) (map[string]map[string]st return nil, errors.Wrap(err, "error parsing wopi discovery response") } - // TODO: Log appUrls? not easy with the format - // It's also a one-time call during service setup, so it's pointless - // to use an "all-is-good" debug log + // We won't log anything if successful return appURLs, nil } diff --git a/services/collaboration/pkg/helpers/registration.go b/services/collaboration/pkg/helpers/registration.go index eea4708375..1908c76e64 100644 --- a/services/collaboration/pkg/helpers/registration.go +++ b/services/collaboration/pkg/helpers/registration.go @@ -43,7 +43,6 @@ func RegisterAppProvider( Str("AppName", cfg.App.Name). Strs("Mimetypes", mimeTypes). Msg("Registering mimetypes in the app provider") - // TODO: REVA has way to filter supported mimetypes (do we need to implement it here or is it in the registry?) // TODO: an added app provider shouldn't last forever. Instead the registry should use a TTL // and delete providers that didn't register again. If an app provider dies or get's disconnected,