singleton icon indicating copy to clipboard operation
singleton copied to clipboard

[BUG] [Ruby Client]Return nil when requested key doesn't exists in service/offlineBundle and source bundle.

Open lyiyu66 opened this issue 3 years ago • 0 comments

Describe the bug commit: ecf8684fb9a7c634160ea25a6d3aec9e9b82c64f Reproducible on online mode and offline mode. Return nil when requested key doesn't exists in service/offlineBundle and source bundle.

To Reproduce Steps to reproduce the behavior:

  1. Invoke below API:
Pre-condition:
# 1)the requested locale/key doesn't in service 
# 2)the requested component in service
# 3)the requested component in source bundle 
# 4)the requested key NOT in source bundle 
@Result_LocaleAndKeyNotInService_ComponentInService_ComponentInSource_KeyNotInSource = SgtnClient::Translation.getString("PLURALS", "new.key1","ru")
puts "@Result: #@Result_LocaleAndKeyNotInService_ComponentInService_ComponentInSource_KeyNotInSource"

Per-condition:
# 1)the requested component/locale in service 
# 2)the requested key doesn't in service
# 3)the requested component in source bundle 
# 4)the requested key doesn't in source bundle
@Result_source_CompoentAndLocaleInService_ComponentInSource_keyNotInSource = SgtnClient::Translation.getString("JAVA", "helloworld_source1", "zh-cn")
# puts "@Result: #@Result_source_CompoentAndLocaleInService_ComponentInSource_keyNotInSource"
  1. See the output is nil @Result: @Result: And log message in stgnclient_d.log file, "Source not found, return key: ", the message is not matched with the API output(nil).
D, [2022-01-26T13:32:51.959909 #37688] DEBUG -- : Source not found, return key: helloworld_source1
...
D, [2022-01-26T13:33:51.484267 #25736] DEBUG -- : Source not found, return key: new.key1

Expected behavior Error and prompt message should be returned in log file.

lyiyu66 avatar Jan 26 '22 09:01 lyiyu66